20 lines
539 B
PHP
20 lines
539 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers\Admin\Navigation;
|
||
|
|
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
use App\Services\NavigationService;
|
||
|
|
use App\Models\NavigationItem;
|
||
|
|
|
||
|
|
class NavigationDestroyController extends Controller
|
||
|
|
{
|
||
|
|
public function __invoke(NavigationItem $navigation, NavigationService $navigationService)
|
||
|
|
{
|
||
|
|
if ($navigationService->delete($navigation)) {
|
||
|
|
return back()->with('success', 'Navigation item removed.');
|
||
|
|
}
|
||
|
|
|
||
|
|
return back()->with('error', 'Failed to remove navigation item.');
|
||
|
|
}
|
||
|
|
}
|