6da3af1364
Fixed OS cache
25 lines
520 B
PHP
25 lines
520 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Cache;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class OS extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = ['name'];
|
|
|
|
protected $table = 'os';
|
|
|
|
public static function allOS(): array
|
|
{
|
|
return Cache::remember("operating_systems", now()->addMonth(1), function () {
|
|
return DB::table('os')->get()->toArray();
|
|
});
|
|
}
|
|
}
|