jeudi 24 mars 2016

Laravel single route point to different controller depending on slugs

I'm new to laravel and I have searched a lot for an answer to my problem but either it's not applicable or I'm not getting it.

I have a FileMaker solution for a client that handle customers and events. Each customer to my client have their own event websites that is managed via the solution. A cms simply. Each customer get a site with a url like clientsite.com/event.

Each page in the event has a page-type and I would like to address different controllers depending on the type.

In routes.php i have:

Route::group(['middleware' => ['sal', 'menu']], function () {

    Route::get('/{event}/{page}', function($event, $page) {
        // Query page for page-type and use controller depending on type
    });
});

There are many page types (standard text/image, specialized forms etc) and therefor I would like to address different controllers.

Event names are always unique but pages are not.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire