Download app/Models/Advertis.php from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 838 Bytes
-
https://huggingface.co/pnacorp/magicai/resolve/main/app/Models/Advertis.php
- Command line
-
hf download hf://pnacorp/magicai/app/Models/Advertis.php
-
curl -L -o Advertis.php https://huggingface.co/pnacorp/magicai/resolve/main/app/Models/Advertis.php
838 Bytes
| namespace App\Models; | |
| use Illuminate\Database\Eloquent\Casts\Attribute; | |
| use Illuminate\Database\Eloquent\Factories\HasFactory; | |
| use Illuminate\Database\Eloquent\Model; | |
| class Advertis extends Model | |
| { | |
| use HasFactory; | |
| protected $table = 'advertis'; | |
| protected $fillable = [ | |
| 'key', | |
| 'title', | |
| 'tracking_code', | |
| 'status', | |
| ]; | |
| protected $casts = [ | |
| 'status' => 'boolean', | |
| ]; | |
| public function trackingCode(): Attribute | |
| { | |
| return Attribute::make( | |
| get: function ($value) { | |
| return json_decode($value, true); | |
| }, | |
| set: function ($value) { | |
| return json_encode($value); | |
| } | |
| ); | |
| } | |
| public function scopeActive($query) | |
| { | |
| return $query->where('status', true); | |
| } | |
| } | |