Created
February 20, 2017 16:32
-
-
Save lloy0076/82d84d9dd3af2736195b5df8aebca4c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
<?php | |
namespace App\Http\Controllers\Admin; | |
use Backpack\CRUD\app\Http\Controllers\CrudController; | |
// VALIDATION: change the requests to match your own file names if you need form validation | |
use App\Http\Requests\MytestRequest as StoreRequest; | |
use App\Http\Requests\MytestRequest as UpdateRequest; | |
class MytestCrudController extends CrudController | |
{ | |
public function setUp() | |
{ | |
/* | |
|-------------------------------------------------------------------------- | |
| BASIC CRUD INFORMATION | |
|-------------------------------------------------------------------------- | |
*/ | |
if ((int)config('backpack.crud.ajax_table_count', 256) !== -1 && | |
\App\Models\Mytest::count() >= config('backpack.crud.ajax_table_count', 256)) | |
{ | |
$this->crud->enableAjaxTable(); | |
} | |
$this->crud->setModel("App\Models\Mytest"); | |
$this->crud->setRoute("/admin/mytest"); | |
$this->crud->setEntityNameStrings('mytest', 'mytests'); | |
/* | |
|-------------------------------------------------------------------------- | |
| BASIC CRUD INFORMATION | |
|-------------------------------------------------------------------------- | |
*/ | |
$this->crud->setFromDb(); | |
// Snipped out other code. | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment