morningtrain / foundation
Tools built on top of laravel 5.4
dev-master / 1.0.x-dev
2017-05-15 09:13 UTC
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-10-29 04:31:11 UTC
README
Admin panel and tools built on top of Laravel 5.4.
Installation
composer require morningtrain\foundation
Setup
- Add the following providers and facades to your app config:
'providers' => [ ... /* * Foundation Service Providers */ \morningtrain\Janitor\JanitorServiceProvider::class, \morningtrain\Stub\StubServiceProvider::class, \morningtrain\Crud\CrudServiceProvider::class, \morningtrain\Themer\ThemerServiceProvider::class, \morningtrain\Acl\AclServiceProvider::class, \morningtrain\Admin\AdminServiceProvider::class, ... ], 'aliases' => [ ... /* * Foundation Facades */ 'Janitor' => \morningtrain\Janitor\Facades\Janitor::class, 'Crud' => \morningtrain\Crud\Facades\Crud::class, 'Stub' => \morningtrain\Stub\Facades\Stub::class, 'Theme' => \morningtrain\Themer\Facades\Theme::class ... ]
-
Update your auth configuration user provider to from App\User to App\Models\User
-
Add the following to your existing authentication controllers
use morningtrain\Admin\Extensions\RedirectsAdmins; class ... { use RedirectsAdmins; ... /** * @return string */ public function redirectPath() { return $this->redirectAdmin($this->guard()) ?: $this->redirectTo; } }
- Publish janitor with initialize flag
php artisan janitor:publish --init
Creating a new crud for the admin panel
- Run the create command with your desired model name
php artisan crud:new MyModel --config=admin.crud
-
Configure migration, model and controller
-
Register the model into the admin configuration (config/admin.php)
[ 'items' => [ ... App\Models\MyModel::class => [ 'icon' => '{material-icon}' ] ... ] ]
- Update (migrates and refreshes the config)
php artisan admin:update