<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ZapPage extends Model
{
    use HasFactory;

    
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'zap_pages';

    /**
    * The database primary key value.
    *
    * @var string
    */
    protected $primaryKey = 'id';

    /**
     * Attributes that should be mass-assignable.
     *
     * @var array
     */
    protected $fillable = [
        'slug',
        'name',
        'title', 
        'sub_title', 
        'description', 
        'content', 
        'is_back_button', 
        'created_by',
    ];
    
    public function zapPageFormButtons(){
        return $this->hasMany('App\Models\ZapPageFormButtons', 'zap_page_id');
    }
    public function zapPageFormFields(){
        return $this->hasMany('App\Models\ZapPageFormFields', 'zap_page_id');
    }
}
