<?php

namespace Modules\GuidedTour\Entities;

use Illuminate\Database\Eloquent\Model;

class TourFlow extends Model
{
    protected $table = 'tour_flows';

    protected $fillable = ['key', 'title', 'vertical', 'is_active', 'autostart_once'];

    protected $casts = [
        'is_active'      => 'boolean',
        'autostart_once' => 'boolean',
    ];

    public function steps()
    {
        return $this->hasMany(TourStep::class, 'flow_id')->orderBy('sort_order');
    }
}
