2017 © Pedro Peláez
 

library foundation

Tools built on top of laravel 5.4

image

morningtrain/foundation

Tools built on top of laravel 5.4

  • Monday, May 15, 2017
  • by morningtrain
  • Repository
  • 6 Watchers
  • 0 Stars
  • 125 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Foundation

Admin panel and tools built on top of Laravel 5.4., (*1)

Installation

    composer require morningtrain\foundation

Setup

  1. 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

        ...
    ]
  1. Update your auth configuration user provider to from App\User to App\Models\User, (*2)

  2. Add the following to your existing authentication controllers, (*3)

    use morningtrain\Admin\Extensions\RedirectsAdmins;

    class ... {
        use RedirectsAdmins;

        ...
        /**
         * @return string
         */
        public function redirectPath()
        {
            return $this->redirectAdmin($this->guard()) ?: $this->redirectTo;
        }
    }
  1. Publish janitor with initialize flag
    php artisan janitor:publish --init

Creating a new crud for the admin panel

  1. Run the create command with your desired model name
php artisan crud:new MyModel --config=admin.crud
  1. Configure migration, model and controller, (*4)

  2. Register the model into the admin configuration (config/admin.php), (*5)

    [
        'items' => [
            ...
            App\Models\MyModel::class   => [
                'icon'  => '{material-icon}'
            ]
            ...
        ]
    ]
  1. Update (migrates and refreshes the config)
php artisan admin:update

The Versions

15/05 2017

dev-master

9999999-dev https://github.com/morningtrain/Foundation

Tools built on top of laravel 5.4

  Sources   Download

MIT

The Requires

 

The Development Requires

foundation morningtrain