From a9adf342c0f253c26b6f77a4343aa5e91d1355a4 Mon Sep 17 00:00:00 2001 From: cp6 Date: Sun, 6 Mar 2022 00:54:24 +1100 Subject: [PATCH] Added os select component Added os select component --- app/Http/Controllers/OsController.php | 5 +++++ app/View/Components/OsSelect.php | 20 +++++++++++++++++++ .../views/components/os-select.blade.php | 10 ++++++++++ 3 files changed, 35 insertions(+) create mode 100644 app/View/Components/OsSelect.php create mode 100644 resources/views/components/os-select.blade.php diff --git a/app/Http/Controllers/OsController.php b/app/Http/Controllers/OsController.php index 33bebeb..784b6b5 100644 --- a/app/Http/Controllers/OsController.php +++ b/app/Http/Controllers/OsController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\OS; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; class OsController extends Controller { @@ -28,6 +29,8 @@ class OsController extends Controller 'name' => $request->os_name ]); + Cache::forget('all_os'); + return redirect()->route('os.index') ->with('success', 'OS Created Successfully.'); } @@ -38,6 +41,8 @@ class OsController extends Controller $items->delete(); + Cache::forget('all_os'); + return redirect()->route('os.index') ->with('success', 'OS was deleted Successfully.'); } diff --git a/app/View/Components/OsSelect.php b/app/View/Components/OsSelect.php new file mode 100644 index 0000000..e7f8b07 --- /dev/null +++ b/app/View/Components/OsSelect.php @@ -0,0 +1,20 @@ + $all_os + ]); + } +} diff --git a/resources/views/components/os-select.blade.php b/resources/views/components/os-select.blade.php new file mode 100644 index 0000000..09749ad --- /dev/null +++ b/resources/views/components/os-select.blade.php @@ -0,0 +1,10 @@ +
+
{{ $title ??'OS'}}
+ +