Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
peripherad
/
app
/
Models
:
StoreLocation.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class StoreLocation extends Model { use HasFactory; protected $fillable = [ 'title', 'address', 'latitude', 'longitude', 'state_id', 'status', 'created_at', 'updated_at', ]; protected $dates = [ 'created_at', 'updated_at', ]; protected $casts = [ 'created_at' => 'date:m-d-Y', 'updated_at' => 'date:m-d-Y', ]; public const STATUS_RADIO = [ '1' => 'Enabled', '0' => 'Disabled', ]; public function state(): BelongsTo { return $this->belongsTo(StateSalesTax::class, 'state_id'); } public function scopeActive($query) { return $query->where('status', 1); } protected function getStatusNameAttribute() { return self::STATUS_RADIO[$this->status]; } }