| 1 | <?php |
||
| 8 | class AdminController extends Controller |
||
| 9 | { |
||
| 10 | use HasResourceActions; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Set title for current resource. |
||
| 14 | * |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $header = ''; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Set description for following 4 action pages. |
||
| 21 | * |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | protected $description = [ |
||
| 25 | // 'index' => 'Index', |
||
| 26 | // 'show' => 'Show', |
||
| 27 | // 'edit' => 'Edit', |
||
| 28 | // 'create' => 'Create', |
||
| 29 | ]; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Index interface. |
||
| 33 | * |
||
| 34 | * @param Content $content |
||
| 35 | * @return Content |
||
| 36 | */ |
||
| 37 | public function index(Content $content) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Show interface. |
||
| 47 | * |
||
| 48 | * @param mixed $id |
||
| 49 | * @param Content $content |
||
| 50 | * @return Content |
||
| 51 | */ |
||
| 52 | public function show($id, Content $content) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Edit interface. |
||
| 62 | * |
||
| 63 | * @param mixed $id |
||
| 64 | * @param Content $content |
||
| 65 | * @return Content |
||
| 66 | */ |
||
| 67 | public function edit($id, Content $content) |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Create interface. |
||
| 77 | * |
||
| 78 | * @param Content $content |
||
| 79 | * @return Content |
||
| 80 | */ |
||
| 81 | public function create(Content $content) |
||
| 88 | } |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: