StatisticalResource.php 589 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Repositories\Models\Dwbs;
  3. use App\Repositories\Models\Model;
  4. class StatisticalResource extends Model
  5. {
  6. /**
  7. * @var string
  8. */
  9. protected $table = 'dwbs_statistical_resources';
  10. protected $guarded = [];
  11. /**
  12. * The attributes excluded from the model's JSON form.
  13. *
  14. * @var array
  15. */
  16. protected $hidden = [];
  17. protected $casts = [
  18. 'user_ids' => 'json'
  19. ];
  20. public function getPathAttribute($val)
  21. {
  22. if (empty($val)) {
  23. return null;
  24. }
  25. return path_to_url($val);
  26. }
  27. }