awcodes/filament-installer
最新稳定版本:v2.0.2
Composer 安装命令:
composer create-project awcodes/filament-installer
包简介
Filament Admin Panel application installer.
README 文档
README
Quickly spin up a new Filament powered application.
Filament Installer is a command-line tool that replaces the Laravel installer and wraps up the most common tasks you might take when creating a Filament app: opening it in your editor and your browser, initialize a git repository, tweak your .env and .env.example, and more.
Requirements
- PHP 8.0+
- (optional, but beneficial) Laravel Valet
Installation
composer global require awcodes/filament-installer
Upgrading
composer global update awcodes/filament-installer
Usage
Make sure ~/.composer/vendor/bin is in your terminal's path.
cd ~/<code-directory> filament new my-cool-filament-app
What exactly does it do?
filament new $PROJECTNAME- Initialize a git repo, add all the files, and, after some changes below, make a commit with the text "Initial commit."
- Replace the
.env(and.env.example) database credentials with the default macOS MySQL credentials: database of$PROJECTNAME, userroot, and empty password - Replace the
.env(and.env.example)APP_URLwith$PROJECTNAME.$YOURVALETTLD - Generate an app key
- Set up dark mode (if opted in)
- Scaffold custom theme assets (if opted in)
- Install and setup Filament Breezy, Filament Shield, or Filament Sentry (if opted in)
- Open the project in your favorite editor
- Open
$PROJECTNAME.$YOURVALETTLDin your browser
Note: If your
$PROJECTNAMEhas dashes (-) in it, they will be replaced with underscores (_) in the database name.
There are also a few optional behaviors based on the parameters you pass (or define in your config file), including creating a database, migrating, running Valet Link and/or Secure, and running a custom bash script of your definition after the fact.
Customizing Filament Installer
While the default actions Filament Installer provides are great, most users will want to customize at least a few of the steps. Thankfully, Filament Installer is built to be customized!
There are three ways to customize your usage of Filament Installer: command-line arguments, a config file, and an "after" file.
Most users will want to set their preferred configuration options once and then never think about it again. That's best solved by creating a config file.
But if you find yourself needing to change the way you interact with Filament Installer on a project-by-project basis, you may also want to use the command-line parameters to customize Filament Installer when you're using it.
Creating a config file
You can create a config file at ~/.filament/config rather than pass the same arguments each time you create a new project.
The following command creates the file, if it doesn't exist, and edits it:
filament edit-config
The config file contains the configuration parameters you can customize, and will be read on every usage of Filament Installer.
Creating an "after" file
You can also create an after file at ~/.filament/after to run additional commands after you create a new project.
The following command creates the file, if it doesn't exist, and edits it:
filament edit-after
The after file is interpreted as a bash script, so you can include any commands here, such as installing additional composer dependencies...
# Install additional composer dependencies as you would from the command line. echo "Installing Composer Dependencies" composer require awcodes/filament-quick-create spatie/laravel-ray
...or copying additional files to your new project.
# To copy standard files to new filament project place them in ~/.filament/includes directory. echo "Copying Include Files" cp -R ~/.filament/includes/ $PROJECTPATH
You also have access to variables from your config file such as $PROJECTPATH and $CODEEDITOR.
Using command-line parameters
Any command-line parameters passed in will override Filament Installer's defaults and your config settings. See a full list of the parameters you can pass in.
Filament Installer Commands
helporhelp-screenshow the help screen
-
edit-configedits your config file (and creates one if it doesn't exist)filament edit-config
-
edit-afteredits your "after" file (and creates one if it doesn't exist)filament edit-after
Configurable parameters
You can optionally pass one or more of these parameters every time you use Filament Installer. If you find yourself wanting to configure any of these settings every time you run Filament Installer, that's a perfect use for the config files.
-
-eor--editorto define your editor command. Whatever is passed here will be run as$EDITOR .after creating the project.# runs "subl ." in the project directory after creating the project filament new my-cool-filament-app --editor=subl -
-por--pathto specify where to install the application.filament new my-cool-filament-app --path=~/Sites -
-mor--messageto set the first Git commit message.filament new my-cool-filament-app --message="This filament runs fast!" -
-for--forceto force install even if the directory already exists# Creates a new Laravel application after deleting ~/Sites/my-cool-filament-app filament new my-cool-filament-app --force -
-dor--devto choose thedevelopbranch instead ofmaster, getting the beta install.filament new my-cool-filament-app --dev
-
-bor--browserto define which browser you want to open the project in.filament new my-cool-filament-app --browser="/Applications/Google Chrome Canary.app" -
-lor--linkto create a Valet link to the project directory.filament new my-cool-filament-app --link
-
-sor--secureto secure the Valet site using https.filament new my-cool-filament-app --secure
-
--create-dbto create a new MySQL database which has the same name as your project. This requiresmysqlcommand to be available on your system.filament new my-cool-filament-app --create-db
-
--migrate-dbto migrate your database.filament new my-cool-filament-app --migrate-db
-
--dbuserto specify the database username.filament new my-cool-filament-app --dbuser=USER
-
--dbpasswordspecify the database password.filament new my-cool-filament-app --dbpassword=SECRET
-
--dbhostspecify the database host.filament new my-cool-filament-app --dbhost=127.0.0.1
-
--darkto use the Filament dark mode by default.filament new my-cool-filament-app --dark
-
--themedto scaffold out the assets needed for a custom Filament theme.filament new my-cool-filament-app --themed
-
--mixto revert Laravel to Laravel Mix instead of Vitefilament new my-cool-filament-app --mix
-
--breezyto install and setup Filament Breezy (authentication plugin).filament new my-cool-filament-app --breezy
-
--shieldto install and setup Filament Shield (authorization plugin).filament new my-cool-filament-app --shield
-
--sentryto install and setup Filament Sentry (authentication, with Breezy, authorization, with Shield and Filament User Resources plugin).filament new my-cool-filament-app --sentry
-
--fullto use--create-db,--migrate-db,--link, and-secure.filament new my-cool-filament-app --full
GitHub Repository Creation
Important: To create new repositories Filament Installer requires one of the following tools to be installed:
- the official GitHub command line tool
- the hub command line tool
Filament Installer will give you the option to continue without GitHub repository creation if neither tool is installed.
-gor--githubto Initialize a new private GitHub repository and push your new project to it.
# Repository created at https://github.com/<your_github_username>/my-cool-filament-app
filament new my-cool-filament-app --github
- Use
--gh-publicwith--githubto make the new GitHub repository public.
filament new my-cool-filament-app --github --gh-public
- Use
--gh-descriptionwith--githubto initialize the new GitHub repository with a description.
filament Installer new my-cool-filament-app --github --gh-description='My cool Filament application'
- Use
--gh-homepagewith--githubto initialize the new GitHub repository with a homepage url.
filament Installer new my-cool-filament-app --github --gh-homepage=https://example.com
- Use
--gh-orgwith--githubto initialize the new GitHub repository with a specified organization.
# Repository created at https://github.com/acme/my-cool-filament-app
filament new my-cool-filament-app --github --gh-org=acme
awcodes/filament-installer 适用场景与选型建议
awcodes/filament-installer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 53 次下载、GitHub Stars 达 14, 最近一次更新时间为 2022 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「console」 「laravel」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 awcodes/filament-installer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 awcodes/filament-installer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 awcodes/filament-installer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
A Laravel package to retrieve data from Google Search Console
Additional artisan commands for Laravel
A table generator class for the PHP CLI.
Slim starter / Slim skeleton package to boost your development with Slim framework
Generates a trait to help ease the access of custom repo methods
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-04