Commit 18fc99c7 authored by Nicolas Widart's avatar Nicolas Widart

Adding the role store method

parent 1bd792e9
<?php namespace Modules\User\Http\Controllers\Admin; <?php namespace Modules\User\Http\Controllers\Admin;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel; use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Laracasts\Flash\Flash;
use Modules\Core\Http\Controllers\Admin\AdminBaseController; use Modules\Core\Http\Controllers\Admin\AdminBaseController;
use Modules\User\Http\Requests\CreateRolesRequest;
class RolesController extends AdminBaseController class RolesController extends AdminBaseController
{ {
...@@ -39,11 +42,16 @@ class RolesController extends AdminBaseController ...@@ -39,11 +42,16 @@ class RolesController extends AdminBaseController
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
* *
* @param CreateRolesRequest $request
* @return Response * @return Response
*/ */
public function store() public function store(CreateRolesRequest $request)
{ {
// $this->roles->create($request->all());
Flash::success('Role created');
return Redirect::route('dashboard.role.index');
} }
/** /**
......
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreateRolesRequest extends FormRequest
{
public function rules()
{
return [
'name' => 'required',
'slug' => 'required',
];
}
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment