<?php

namespace App\Models;

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

class carcompany extends Model
{
    use HasFactory;
    protected $table = 'carcompany';
    
    protected $fillable = [
        'id',
        'company_name',
        'status',
        'created_at',
        'created_by',
        'updated_at',
        'updated_by'
    ];
    
    public function export($slug){
        $collection = DB::table('carcompany')
                        ->select('company_name','status','created_at');

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