diff --git a/app/Http/Controllers/OsController.php b/app/Http/Controllers/OsController.php index 689b6ec..aac4d34 100644 --- a/app/Http/Controllers/OsController.php +++ b/app/Http/Controllers/OsController.php @@ -10,7 +10,7 @@ class OsController extends Controller { public function index() { - $os = OS::allOS(); + $os = OS::allOS()->toArray(); return view('os.index', compact(['os'])); } diff --git a/app/Models/OS.php b/app/Models/OS.php index 01cd59b..3a493a5 100644 --- a/app/Models/OS.php +++ b/app/Models/OS.php @@ -16,10 +16,10 @@ class OS extends Model protected $table = 'os'; - public static function allOS(): array + public static function allOS() { return Cache::remember("operating_systems", now()->addMonth(1), function () { - return self::orderBy('name')->get()->toArray(); + return self::orderBy('name')->get(); }); } } diff --git a/app/View/Components/OsSelect.php b/app/View/Components/OsSelect.php index 2036155..4476f90 100644 --- a/app/View/Components/OsSelect.php +++ b/app/View/Components/OsSelect.php @@ -11,7 +11,7 @@ class OsSelect extends Component public function render() { return view('components.os-select', [ - 'os' => OS::allOS() + 'os' => OS::allOS()->toArray() ]); } }