25 lines
478 B
PHP
25 lines
478 B
PHP
|
<?php
|
||
|
|
||
|
namespace App;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Illuminate\Support\Str;
|
||
|
|
||
|
class Home extends Model
|
||
|
{
|
||
|
protected $fillable = [
|
||
|
'title', 'price', 'surface', 'garden_surface', 'rooms', 'energy',
|
||
|
'ges', 'description', 'city', 'pictures', 'map', 'url',
|
||
|
];
|
||
|
|
||
|
protected $casts = [
|
||
|
'map' => 'array',
|
||
|
'pictures' => 'array',
|
||
|
];
|
||
|
|
||
|
public function excerpt()
|
||
|
{
|
||
|
return Str::words($this->description, 10);
|
||
|
}
|
||
|
}
|