<?php

/**
 * Package Routes
 */

Route::group(['namespace' => 'Taskforcedev\CrudAPI\Http\Controllers'], function () {
    Route::group(['prefix' => 'api'], function () {
        Route::get('{model}/{id}', 'ApiController@show');
        Route::get('{model}', 'ApiController@index');
        Route::post('{model}', 'ApiController@store');
        Route::delete('{model}/{id}', 'ApiController@destroy');
    });

    Route::group(['prefix' => 'admin/crud'], function () {
        Route::get('{model}/{id}', 'AdminController@show');
        Route::get('{model}', 'AdminController@index');
        Route::post('{model}', 'AdminController@store');
    });
});

<?php

/**
 * Package Routes
 */

Route::group(['namespace' => 'Taskforcedev\CrudAPI\Http\Controllers'], function () {
    Route::group(['middleware' => 'web', 'prefix' => 'api'], function () {
        Route::get('{model}/{id}', 'ApiController@show');
        Route::get('{model}', 'ApiController@index');
        Route::post('{model}', 'ApiController@store');
        Route::delete('{model}/{id}', 'ApiController@destroy');
    });

    Route::group(['middleware' => 'web', 'prefix' => 'admin/crud'], function () {
        Route::get('{model}/{id}', 'AdminController@show');
        Route::get('{model}', 'AdminController@index');
        Route::post('{model}', 'AdminController@store');
    });
});

Add route middleware (requires 5.2 laravel+ now to work).
Add route middleware (requires 5.2 laravel+ now to work).
