<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Builder;

class Customer extends User
{
    protected $table = 'users';

    protected static function booted()
    {
        static::addGlobalScope('customer', function (Builder $builder) {
            $builder->where('role', 'customer');
        });

        static::creating(function ($customer) {
            $customer->role = 'customer';
        });
    }
}
