Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::post('something/{xtype}/{xid}/execute/{yid}', 'MyController@execute');
- public function execute($xtype, $xid, $yid)
- {
- // business logic
- return back();
- }
- <form action="/something/{{ $something->xtype }}/{{ $something->xid }}/execute/{{ $others->yid }}" method="POST" id="y_{{ $others->yid }}">
- {!! csrf_field() !!}
- </form>
- <a type="button" href="#" onClick="document.getElementById('y_{{ $others->yid }}').submit()">
- public function handle($request, Closure $next)
- {
- if (Sentinel::check())
- {
- if (Sentinel::getUser()->roles()->first()->slug == 'admin')
- {
- return $next($request);
- }
- }
- return redirect()->guest('/login')
- ->with(['error' => "You do not have the permission.."]);
- }
- }
Add Comment
Please, Sign In to add comment