<?php

namespace App\Models;

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

class CancellationReason extends Model{
    use HasFactory;
    protected $table = 'cancellation';
    
    protected $fillable = [
        'name',
        'status',
        'created_at',
        'updated_at'
    ];

    public function export($slug){
        $collection = DB::table('cancellation')
                        ->select('name','status');

        
        $data = $collection->get();
        
        if($data->isNotEmpty()){
            return $data;
        }else{
            return null;
        }
    }
}
