mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
feat(#17): add commands and jobs to poll, download and update firmware feat(#17): update firmware modal feat(#17): add tests
25 lines
439 B
PHP
25 lines
439 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Firmware extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'latest' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public static function getLatest(): ?self
|
|
{
|
|
return self::where('latest', true)->first();
|
|
}
|
|
}
|