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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ndRd2d
via IFTTT

Aucun commentaire:

Enregistrer un commentaire