restore composer.json, add mysqli extension
This commit is contained in:
39
app/Models/Color.php
Executable file
39
app/Models/Color.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
/**
|
||||
* Class Color
|
||||
* @property string|null $name
|
||||
* @property string|null $color
|
||||
* @mixin
|
||||
*/
|
||||
class Color extends Model
|
||||
{
|
||||
protected $table = 'colors';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'color'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'name' => 'array',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at', 'updated_at'
|
||||
];
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return (string) $this->name[App::getLocale()] ?? null;
|
||||
}
|
||||
|
||||
public function getColor(): string
|
||||
{
|
||||
return (string) $this->color;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user