Download src/app/Models/Language.php from pnacorp/xsender: direct link, hf CLI and curl.
- Browser
- Download file 822 Bytes
-
https://huggingface.co/pnacorp/xsender/resolve/main/src/app/Models/Language.php
- Command line
-
hf download hf://pnacorp/xsender/src/app/Models/Language.php
-
curl -L -o Language.php https://huggingface.co/pnacorp/xsender/resolve/main/src/app/Models/Language.php
822 Bytes
| namespace App\Models; | |
| use App\Enums\StatusEnum; | |
| use Illuminate\Database\Eloquent\Factories\HasFactory; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Support\Str; | |
| use Illuminate\Database\Eloquent\Builder; | |
| use App\Traits\Filterable; | |
| class Language extends Model | |
| { | |
| use HasFactory, Filterable; | |
| protected $guarded = []; | |
| protected static function booted() | |
| { | |
| static::creating(function (Model $model) { | |
| $model->uid = Str::uuid(); | |
| $model->status = StatusEnum::TRUE->status(); | |
| }); | |
| } | |
| public function scopeDefault(Builder $q) : Builder{ | |
| return $q->where('is_default',(StatusEnum::TRUE)->status()); | |
| } | |
| public function scopeActive(Builder $q) :Builder{ | |
| return $q->where('status',(StatusEnum::TRUE)->status()); | |
| } | |
| } | |