mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
Color palette support in byos_laravel
This commit is contained in:
parent
c157dcf3b6
commit
9ee7bc1aac
7 changed files with 236 additions and 4 deletions
|
|
@ -6,6 +6,7 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
final class DeviceModel extends Model
|
||||
{
|
||||
|
|
@ -25,6 +26,11 @@ final class DeviceModel extends Model
|
|||
'published_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function palette(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Palette::class);
|
||||
}
|
||||
|
||||
public function getColorDepthAttribute(): ?string
|
||||
{
|
||||
if (! $this->bit_depth) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue