ZapPage.php 968 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. class ZapPage extends Model
  6. {
  7. use HasFactory;
  8. /**
  9. * The database table used by the model.
  10. *
  11. * @var string
  12. */
  13. protected $table = 'zap_pages';
  14. /**
  15. * The database primary key value.
  16. *
  17. * @var string
  18. */
  19. protected $primaryKey = 'id';
  20. /**
  21. * Attributes that should be mass-assignable.
  22. *
  23. * @var array
  24. */
  25. protected $fillable = [
  26. 'slug',
  27. 'name',
  28. 'title',
  29. 'sub_title',
  30. 'description',
  31. 'content',
  32. 'is_back_button',
  33. 'created_by',
  34. ];
  35. public function zapPageFormButtons(){
  36. return $this->hasMany('App\Models\ZapPageFormButtons', 'zap_page_id');
  37. }
  38. public function zapPageFormFields(){
  39. return $this->hasMany('App\Models\ZapPageFormFields', 'zap_page_id');
  40. }
  41. }