mercredi 23 septembre 2015

Laravel 5 Routing - understanding

I am trying to debug a Laravel 5.o code. I have learnt from here.

But what I am facing, is not like that. What I am trying to debug is something like this -

    <?php

    get("/test",function(){
        return $webinar = \App\Webinar::with('subscribers')->find(1);
    });

    Route::controllers([
        'auth' => 'Auth\GTWAuthController',
        'members' => 'MembersController',
        'customers' => 'CustomersController'
    ]);

    resource('users', 'Resources\UsersController');
    resource('users.subscribers-lists', 'Resources\SubscribersListController');
    resource('users.subscribers-lists.subscribers', 'Resources\SubscribersController');
    resource('users.webinars', 'Resources\WebinarsController');
    resource('users.panelists', 'Resources\PanelistsController');

    resource('qas', 'Resources\QAController');

    Route::group(array('prefix' => '/'), function() {
        Route::get('/webinar/{webinar_id}/{subscriber}', 
            array('as' => 'site.webinar', 'uses' => 'WebinarController@index'));


    ////////////////////////////////////////////////////Testing
    Route::get('test','CustomersController@getTest');
    Route::post('add_question','CustomersController@add_question');
    ///////////////////////////////////////////////////////////

        Route::get('/webinar/{webinar_id}/panelist', array('middleware' => 'user.panelist', 'as' => 'site.panelist.webinar', 'uses' => 'WebinarController@index'));
    });

So, I can't understand how routs are working, can anyone help meplahow this outs are working?

Thanks for helping.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire