// SYSTEM PANEL //
[ROOT]
/
mnt
/
pleskStorage
/
vhosts
/
kodsolutions.net
/
subdomains
/
go-rent.kodsolutions.net
/
app
/
Models
[ PARENT ]
EDIT :: Banner.php
<?php namespace App\Models; use App\Helpers\Constants; use Illuminate\Database\Eloquent\Factories\HasFactory; use Spatie\Translatable\HasTranslations; class Banner extends Model { use HasFactory; use HasTranslations; public $translatable = ['title', 'image', 'sub_title', 'description']; protected $fillable = [ 'title', 'sub_title', 'description', 'slug', 'image', 'type', 'position', 'active', 'link', ]; public function scopeFirst($query) { return $query->where('type', Constants::FIRST_BANNER); } public function scopeSecond($query) { return $query->where('type', Constants::SECOND_BANNER); } // type span public function getTypeSpanAttribute() { $value = ''; if ($this->type == Constants::FIRST_BANNER) { $value = "<span class='style3 pending-style badge rounded-pill badge-soft-danger font-size-11'>".__('attributes.first').'</span>'; } elseif ($this->type == Constants::SECOND_BANNER) { $value = "<span class='style1 pending-style badge rounded-pill badge-soft-success font-size-11'>".__('attributes.second').'</span>'; } return $value; } }
SAVE
CANCEL