2022-03-05 16:02:12 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2022-05-09 06:57:38 +02:00
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
2022-03-05 16:02:12 +01:00
|
|
|
|
|
|
|
class OS extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
2022-03-05 16:58:25 +01:00
|
|
|
protected $fillable = ['name'];
|
|
|
|
|
2022-03-05 16:02:12 +01:00
|
|
|
protected $table = 'os';
|
2022-05-09 06:57:38 +02:00
|
|
|
|
|
|
|
public static function allOS(): array
|
|
|
|
{
|
|
|
|
return Cache::remember("operating_systems", now()->addMonth(1), function () {
|
|
|
|
return DB::table('os')->get()->toArray();
|
|
|
|
});
|
|
|
|
}
|
2022-03-05 16:02:12 +01:00
|
|
|
}
|