| 1 | <?php |
||
| 11 | class RolesController extends Controller |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Validation rules for changing data. |
||
| 15 | * |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $rules = ['name' => 'required']; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * List all accessible roles. |
||
| 22 | * |
||
| 23 | * @return Collection|static[] |
||
| 24 | */ |
||
| 25 | public function index() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Create new role. |
||
| 34 | * |
||
| 35 | * @param Request $request |
||
| 36 | * @return Model |
||
| 37 | */ |
||
| 38 | public function store(Request $request) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Update existent role. |
||
| 47 | * |
||
| 48 | * @param Request $request |
||
| 49 | * @param $id |
||
| 50 | */ |
||
| 51 | public function update(Request $request, $id) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Show a single role. |
||
| 62 | * |
||
| 63 | * @param $id |
||
| 64 | * @return mixed |
||
| 65 | */ |
||
| 66 | public function show($id) |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Delete a single role. |
||
| 77 | * |
||
| 78 | * @param $id |
||
| 79 | */ |
||
| 80 | public function destroy($id) |
||
| 86 | } |