mercredi 29 novembre 2017

BaseController for all controllers

I have many controllers which get CRUD functions. Some of this functions is copy-paste.

I want to create BaseController which has base functions.

But how identify entity?

I have routes:

    Route::group(['namespace' => 'Posts', 'prefix' => 'posts'], function () {
    Route::get('/', 'PostController@index');
});

and function:

public function index()
{
    return Post::filter(Request::input())->paginate()->appends(Request::input());
}

How i can determinate entity Post?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire