redirect if no locations
This commit is contained in:
parent
2e88c51ac7
commit
16222d1bd7
2 changed files with 6 additions and 0 deletions
|
@ -65,6 +65,11 @@ class NodesController extends Controller
|
|||
|
||||
public function getNew(Request $request)
|
||||
{
|
||||
if (!Models\Location::all()->count()) {
|
||||
Alert::warning('You must add a location before you can add a new node.')->flash();
|
||||
return redirect()->route('admin.locations');
|
||||
}
|
||||
|
||||
return view('admin.nodes.new', [
|
||||
'locations' => Models\Location::all()
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue