xmen/starter-kit
Composer 安装命令:
composer require xmen/starter-kit
包简介
关键字:
README 文档
README
An Starter Kit For Laravel Projects.
Installation
1-Install the package via composer:
composer require xmen/starter-kit
2-Publish and run the migrations with:
php artisan vendor:publish --provider="Xmen\StarterKit\StarterKitServiceProvider" --tag="migrations" php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations" php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" php artisan migrate
3-Publish the assets with:
php artisan vendor:publish --provider="Xmen\StarterKit\StarterKitServiceProvider" --tag="assets" php artisan vendor:publish --provider="Xmen\StarterKit\StarterKitServiceProvider" --tag="fonts"
4-Publish the language file with:
php artisan vendor:publish --provider="Xmen\StarterKit\StarterKitServiceProvider" --tag="lang"
5-Add StarterKit trait to User model:
use Xmen\StarterKit\Models\StarterKit; class User extends Authenticatable { use StarterKit; ... }
6-Change the home path to dashboard in RouteServiceProvider:
//app/Providers/RouteServiceProvider.php public const HOME = '/dashboard';
7-Add role middleware to Kernel.php:
//app/Http/Kernel.php protected $routeMiddleware = [ ... 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, ];
You can publish the config file with:
php artisan vendor:publish --provider="Xmen\StarterKit\StarterKitServiceProvider" --tag="config"
This is the contents of the published config file:
return [ //The dashboard uri 'uri'=>'dashboard', ];
Usage
Create admin user by running install command and then login to dashboard:
php artisan starter-kit:install
Also install laravel/ui if you need login/registration.
Laravel 9 and above:
composer require laravel/ui php artisan ui vue php artisan ui vue --auth
Laravel 8.x :
composer require laravel/ui php artisan ui bootstrap php artisan ui vue php artisan ui bootstrap --auth
Laravel 6.x & 7.x
composer require laravel/ui "^2.4"
php artisan ui bootstrap
php artisan ui vue
php artisan ui bootstrap --auth
fix auth pages css
You must add this line to app.layout.blade.php:
<link href="{{ asset('vendor/starter-kit/css/app.css') }}" rel="stylesheet">
Laravel Scout
Some models have been integrated with scout and tntsearch driver, like Post model. You could use power of scout in these models.
If you are installing starter kit in an existing project, you can import models with this command:
php artisan scout:import \\Xmen\\StarterKit\\Models\\Post
For more information see scout document
Javascript
When customizing starterKit, you may use a variety of helpers that are globally available to your JavaScript components. The $,axios,chart,alertify are globally available.
Adding Javascript and css
You could add javascript and css file to dashboard with a name and file path.
\StarterKit::script('new-chart',resource_path('js/new-chart.js')); \StarterKit::style('new-color',resource_path('scss/new-color.css'));
Update
After updating to a new StarterKit release, you should be sure to update StarterKit's JavaScript and CSS assets and language file using publish command and
clear any cached views with view:clear.
This will ensure the newly-updated StarterKit version is using the latest versions.
php artisan starter-kit:publish --force
notes
If you have problem with laravel mix, /vendor/xmen/starter-kit/package-sample.json could help you. BTW don't forget to have got backup form you package.json
Add persian jdate & fix pagination
// AppServiceProvider.php top of file use Xmen\StarterKit\Helpers\TDate; // in the boot function public function boot() { // Carbon::setLocale('fa_IR'); Carbon::macro('jdate', function ($format) { $dt = new TDate(); return $dt->PDate($format,self::this()->timestamp); }); Paginator::useBootstrap(); }
useage persion date
Then you can use your custom format like this everywhere.
$user->created_at->jdate('Y/m/d');
Testing
composer test
Translate your language or words
php artisan vendor:publish --provider="Translator\Framework\TranslatorServiceProvider"
Security
If you discover any security related issues, please email sadeghpm@gmail.com instead of using the issue tracker.
Credits
Screenshot & Online tutorial (Persian)
https://aparat.com/v/TAvPy
License
The MIT License (MIT). Please see License File for more information.
xmen/starter-kit 适用场景与选型建议
xmen/starter-kit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 748 次下载、GitHub Stars 达 162, 最近一次更新时间为 2020 年 08 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「starter-kit」 「xmen」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xmen/starter-kit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xmen/starter-kit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xmen/starter-kit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A modern PHP starter kit with MVC.
The starter kit with Laravel and VueJS
A Laravel 13 starter kit powered by Inertia.js, Vue 3, Fortify, and Spatie packages.
Laravel 13 + Inertia v3 + Vue 3 + Tailwind 4 + daisyUI 5 + Ziggy starter kit with Fortify authentication.
Laravel 7 Admin Panel for lazy developers. Contains User Management, Roles and Permission Management, Activity Logging
A foundational package for streamlined development, offering essential core functionality and components to accelerate project creation and enhance scalability.
统计信息
- 总下载量: 748
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 164
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MPL-2.0
- 更新时间: 2020-08-29
