mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Moved gate to the top of the method
This commit is contained in:
parent
025ea93f05
commit
6066c249d5
|
@ -96,12 +96,13 @@ class ManufacturersController extends Controller
|
||||||
*/
|
*/
|
||||||
public function edit($id = null)
|
public function edit($id = null)
|
||||||
{
|
{
|
||||||
|
// Handles manufacturer checks and permissions.
|
||||||
|
$this->authorize('update', Manufacturer::class);
|
||||||
|
|
||||||
// Check if the manufacturer exists
|
// Check if the manufacturer exists
|
||||||
if (!$item = Manufacturer::find($id)) {
|
if (!$item = Manufacturer::find($id)) {
|
||||||
return redirect()->route('manufacturers.index')->with('error', trans('admin/manufacturers/message.does_not_exist'));
|
return redirect()->route('manufacturers.index')->with('error', trans('admin/manufacturers/message.does_not_exist'));
|
||||||
}
|
}
|
||||||
//Handles manufacturer checks and permissions.
|
|
||||||
$this->authorize('update', Manufacturer::class);
|
|
||||||
|
|
||||||
// Show the page
|
// Show the page
|
||||||
return view('manufacturers/edit', compact('item'));
|
return view('manufacturers/edit', compact('item'));
|
||||||
|
|
Loading…
Reference in a new issue