You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
478 B

  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Support\Str;
  5. class Home extends Model
  6. {
  7. protected $fillable = [
  8. 'title', 'price', 'surface', 'garden_surface', 'rooms', 'energy',
  9. 'ges', 'description', 'city', 'pictures', 'map', 'url',
  10. ];
  11. protected $casts = [
  12. 'map' => 'array',
  13. 'pictures' => 'array',
  14. ];
  15. public function excerpt()
  16. {
  17. return Str::words($this->description, 10);
  18. }
  19. }