first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Attraction extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable = [
|
||||
'city_id',
|
||||
'name',
|
||||
'description',
|
||||
'latitude',
|
||||
'longitude',
|
||||
'category',
|
||||
'source',
|
||||
'source_id',
|
||||
'rating',
|
||||
'image_url',
|
||||
'cached_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'latitude' => 'decimal:7',
|
||||
'longitude' => 'decimal:7',
|
||||
'rating' => 'decimal:2',
|
||||
'cached_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the city that owns this attraction
|
||||
*/
|
||||
public function city(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(City::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user