File manager - Edit - /var/www/html/portal/app/Models/Comunicacao/Banner.php
Back
<?php namespace App\Models\Comunicacao; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Illuminate\Support\Str; use DateTimeInterface; class Banner extends Model { use HasApiTokens, HasFactory, Notifiable; protected $connection = 'mysql'; public $incrementing = false; protected $keyType = 'string'; protected $table = 'banners'; const CREATED_AT = 'created_at'; const UPDATED_AT = 'updated_at'; protected $fillable = [ 'id', 'created_at', 'updated_at', 'title', 'url', 'photo', 'photoMD', 'photoSM', 'order', 'target', 'section', 'status', ]; public static function ativosPorSecao(string $section) { return self::where('section', $section) ->where('status', 'ATIVADO') ->orderBy('order', 'ASC') ->get(); } public static function boot() { parent::boot(); static::creating(function ($model) { $model->id = Str::uuid(); }); } protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.09 |
proxy
|
phpinfo
|
Settings