<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

class ExportProFile extends Model
{
    protected $fillable = [
        'type',
        'keyword',
        'original_name',
        'stored_path',
        'order',
    ];

    protected function casts(): array
    {
        return [
            'order' => 'integer',
        ];
    }

    public function scopePrefix(Builder $query): Builder
    {
        return $query->where('type', 'prefix');
    }

    public function scopePostfix(Builder $query): Builder
    {
        return $query->where('type', 'postfix');
    }

    public function scopeKeyword(Builder $query): Builder
    {
        return $query->where('type', 'keyword');
    }
}
