<?php

namespace App\Models;

use Cassandra\Custom;
use Illuminate\Database\Eloquent\Model;

class Company extends Model
{

    protected $table = 'company';

    public function locations(){
        return $this->hasMany(CompanyLocation::class, 'company_id', 'id')->orderBy('line1', 'ASC');
    }

    public function customers(){
        return $this->hasMany(Customer::class, 'company_id', 'id')->orderBy('created_at', 'DESC');
    }

    public function giftCards(){
        return $this->hasMany(GiftCard::class, 'company_id', 'id')->orderBy('created_at', 'DESC');
    }

}
