<?php

namespace App\Models\WS;

use Illuminate\Database\Eloquent\Model;

class Contact extends Model
{
    protected $fillable = ['email','phone','address','lat','long','location','created_by','updated_by'];
    protected $casts = ['created_at' => 'date:d/m/Y'];
    
    public static function boot()
    {
        Parent::boot();
        static::creating(function ($model) {
            $model->created_by = auth()->id();
        });

        static::updating(function($model){
            $model->updated_by = auth()->id();
        });
    }
}
