Skip to content

Commit

Permalink
add translatable fields to model
Browse files Browse the repository at this point in the history
  • Loading branch information
alibaghernia committed May 9, 2024
1 parent 7eddd44 commit 318fdf6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/Models/CafeRestaurant.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,25 @@
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Notifications\Notifiable;
use Spatie\Translatable\HasTranslations;

class CafeRestaurant extends Model
{
use HasFactory,
Notifiable;
Notifiable,
HasTranslations;

public array $translatable = [
'name',
'description',
'address',
];

protected $casts = [
'name' => 'array',
'description' => 'array',
'address' => 'array',
];

public function manager(): HasOne
{
Expand Down

0 comments on commit 318fdf6

Please sign in to comment.