mercredi 30 mars 2016

Can i add sub route in Route::get?

I need control sub route by User Config

  • i can't get request/route parameters on Route::group
  • middleware run after Route::group
  • Can't Include file sub route in Route::get

How do you do.

Example.

Route.php

Route::group(['prefix' => '/{user}'], function () { 

    Route::group(['prefix' => '/map'], function () { require app_path('map.route.php'); });
    Route::group(['prefix' => '/contact'], function () { require app_path('contact.route.php'); });

    Route::group(['prefix'=>'/'], function(){

      $user = \App\User::find($user);
       if( $user -> first_page )
       {
        require app_path($user -> first_page.'.route.php');
       }

    });

});

Thank you very much.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire