Publish Layout

  1. Run Publish Layout Command
  2. Check Published Stuff
  3. Customization
  4. Menu Configuration

Run Publish Layout Command

Generator also provides a quick way to publish layout and auth scaffold using the following command.

php artisan infyom.publish:layout 

Check Published Stuff

This command generates following files,

  1. It will publish HomeController in controllers directory
  2. It will publish views
    • resources
      • views
        • home.blade.php
        • layouts
          • app.blade.php
          • menu.blade.php
          • sidebar.blade.php
        • emails
          • password.blade.php
        • auth
          • login.blade.php
          • register.blade.php
          • reset.blade.php
          • password.blade.php
  3. It will add following routes which need to get it work.
    Route::get('login', 'Auth\AuthController@getLogin');
    Route::post('login', 'Auth\AuthController@postLogin');
    Route::get('logout', 'Auth\AuthController@getLogout');
    Route::get('register', 'Auth\AuthController@getRegister');
    Route::post('register', 'Auth\AuthController@postRegister');
    Route::get('password/reset', 'Auth\PasswordController@getEmail');
    Route::post('password/email', 'Auth\PasswordController@postEmail');
    Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
    Route::post('password/reset', 'Auth\PasswordController@postReset');
    Route::get('/home', 'HomeController@index'); 


After that, you need to do following two changes:

  1. Openapp/Http/Middleware/Authenticate.php.

    Find the line return redirect()->guest('auth/login'); in handle function and replace it with, return redirect()->guest('/login');

  2. Open app/Http/Controllers/Auth/AuthController.php and add the following properties

    protected $loginPath = '/login';
    protected $redirectTo = '/home';
    protected $redirectAfterLogout = '/login';

Now, you have to enable menu option in config/infyom/laravel_generator.php. Make menu option true.

'add_on' => [ 'menu' => [ 'enabled' => true ] ] is where menu for particular module will be added. If you want to customize it then you can customize it. It will take a respective path from views folder you configured in laravel_generator.php.

Now we are all set and you can check basic scaffolding.