Banner.php 522 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Repositories\Models\Base;
  3. use App\Repositories\Models\Model;
  4. class Banner extends Model
  5. {
  6. /**
  7. * @var string
  8. */
  9. protected $table = 'base_banners';
  10. protected $guarded = [];
  11. /**
  12. * The attributes excluded from the model's JSON form.
  13. *
  14. * @var array
  15. */
  16. protected $hidden = [];
  17. public function getUrlAttribute()
  18. {
  19. if (array_key_exists('path', $this->attributes)) return path_to_url($this->attributes['path']);
  20. return '';
  21. }
  22. }