daniacademy/filament-skeleton
Composer 安装命令:
composer create-project daniacademy/filament-skeleton
包简介
A starter template for Filament V3 and Laravel, preconfigured with authentication, roles, permissions, and much more.
README 文档
README
Filament Skeleton Template
This repository is a ready-to-use skeleton for building Laravel applications with Filament Admin. It includes several pre-configured packages and functionalities to streamline your development process.
Features
- Filament Shield: Role and permission management made simple.
- Spatie Health: Monitor and ensure the health of your application.
- Laravel Audit: Track model changes and activity.
- Task Scheduler Configuration: Pre-configured tasks to handle essential maintenance:
Schedule::command('queue:work --stop-when-empty')->everyMinute() ->withoutOverlapping(); Schedule::command('health:queue-check-heartbeat')->everyMinute(); Schedule::command('logs:clean')->daily()->at('00:00'); Schedule::command('audit:clean')->daily()->at('00:30'); Schedule::command('backup:clean')->daily()->at('01:00'); Schedule::command('backup:run')->daily()->at('01:30'); Schedule::command('db:optimize')->daily()->at('03:00');
- Security Headers and Content Security Policy (CSP): Middleware is included to enhance security using Spatie CSP.
- Customized Login Throttling: Throttling behavior is adjusted to focus on individual users rather than their IP address, ensuring multiple users from the same IP are not blocked due to one user's failed attempts.
- Blade Font Awesome: Easily integrate Font Awesome icons.
- Spatie Media Library Integration: Seamless file and media management through Filament.
- Filament Notifications: Customize elegant and dynamic notifications with icons, colors, and interactive actions.
- Edit Profile: Allow users to easily update their profile information and securely change their password directly from the Filament panel.
- Disable lazy loading in Laravel with
preventLazyLoading()method: Taylor Otwell tweeted about this new feature available in Laravel 8.43.0 that disables lazy loading your Eloquent models, avoiding the N+1 problem. This way every time you use lazy loading, an exception will be thrown, but only on non-production environment, so no need to worry about crashing your production if you miss something. - Production Script in Composer: This script optimizes a Laravel and Filament application for a production environment. It performs the following actions: runs composer dump-autoload -o, caches configuration, routes, and views, caches Filament components, and executes Laravel's optimization commands.
- PHP Insights: This project comes with PHP Insights pre-configured and ready to use, providing real-time code quality analysis, including maintainability, complexity, and security insights. Easily ensure your codebase adheres to modern best practices without additional setup.
- Laravel Enlightn: This project comes with Laravel Enlightn seamlessly integrated, providing actionable insights to optimize performance, enhance security, and ensure code maintainability. With Enlightn pre-configured, you can instantly identify and address potential issues, delivering a more robust and efficient Laravel application from the start.
How to Use
This project can be deployed in two ways: as a Composer project or as a GitHub template. Regardless of the chosen method, make sure to continue with the "How to deploy" section to complete the installation and configuration.
Option 1: Using Composer
- Create your project with Composer:
composer create-project daniacademy/filament-skeleton projectName
- Then, proceed to the steps in the "How to deploy" section.
Option 2: Using GitHub Template
- Create a new repository using this skeleton as a template.
- Clone your new repository locally.
- Install dependencies:
composer install
- Copy the
.env.examplefile and rename it to.env:cp .env.example .env
- Finally, continue with the steps in the "How to deploy" section.
How to deploy
- Ensure that you are located in the root directory of the application before proceeding with the deployment steps.
- Configure your database and other environment variables in the
.envfile. - Generate the application key:
php artisan key:generate
- Run migrations:
php artisan migrate
- Seed the database:
php artisan db:seed
- Create a super-admin user:
php artisan shield:super-admin
Running on production environment
-
Optimize the Laravel and Filament Application It is highly recommended to optimize Laravel and Filament to enhance the application's performance. To do so, run the following command:
composer production
Remember to execute this command after making any changes or deploying a new release to production.
-
Review
canAccessPanel()Method for ProductionFor enhanced security in a production environment, it's recommended to review and customize the
canAccessPanel()method within theUsermodel. This method controls access to the admin panel and can be tailored to enforce specific conditions, such as restricting access based on user roles, permissions, or other business logic.By default, the
canAccessPanel()method in theUsermodel returnstrue, allowing all users to access the admin panel.Default Implementation:
public function canAccessPanel(): bool { return true; }
To adapt the method for your production environment, you can define specific conditions based on your application's requirements. Below is an example of how to customize the
canAccessPanel()method:Example: Customizing
canAccessPanel()public function canAccessPanel(): bool { return $this->hasRole('Admin') || $this->is_super_admin; }
Taking this step ensures that only authorized users can access the admin panel, reducing potential vulnerabilities in your application.
Default Super-Admin Credentials
The default credentials for accessing the application as a super-admin are:
- Email:
admin@example.com - Password:
123456
By default, you can access the admin panel at http://localhost/admin. Ensure your local server is running, and the necessary configurations in your .env file are correctly set up to avoid access issues.
Notes
This template is designed with love ❤️ to provide a robust starting point for Laravel applications built with Filament Admin. It includes pre-installed packages and essential configurations to reduce setup time and enhance productivity.
Feel free to customize and extend it as needed for your projects.
Acknowledgments
I would like to express my gratitude to Laravel and Filament for their invaluable contributions to the community and their continuous effort in advancing the ecosystem. Their work has made web development more efficient and enjoyable.
I would also like to thank my family for their patience and understanding during the many hours I spend working on development. Their support means the world to me.
Thank you all!
daniacademy/filament-skeleton 适用场景与选型建议
daniacademy/filament-skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 12 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「template」 「laravel」 「Skeleton」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 daniacademy/filament-skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 daniacademy/filament-skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 daniacademy/filament-skeleton 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Simple ASCII output of array data
E2E Studios PHP Framework adaptation of leafsphp/blade package
Alfabank REST API integration
Ensolab template project
Account Balance / Wallets Manager For FilamentPHP and Filament Account Builder
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-07
