Created
February 6, 2017 14:00
-
-
Save endihunter/5ae7d1c7a0f1e7f1f1aa508ce7bc6ee2 to your computer and use it in GitHub Desktop.
scaffolding delete method
This file contains 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 | |
public function delete(Module $module) | |
{ | |
$this->authorize('delete', $eloquent = app('scaffold.model')); | |
app('scaffold.actions')->exec('delete', [$eloquent]); | |
$message = trans('administrator::messages.remove_success'); | |
if (URL::previous() == route('scaffold.view', ['module' => $module, 'id' => $eloquent->id])) { | |
return redirect()->to($this->getPreviousUrl())->with('messages', [$message]); | |
} | |
return redirect()->to(route('scaffold.index', ['module' => $module]))->with('messages', [$message]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment