Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/app/Models/Product.php
Назад
<?php namespace App\Models; use App\Models\Principal; use \DateTimeInterface; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use ESolution\DBEncryption\Traits\EncryptedAttribute; use App\Traits\Observable; class Product extends Model { // use SoftDeletes; use HasFactory,EncryptedAttribute,Observable,SoftDeletes; public $table = 'products'; protected $appends = [ 'photo', ]; protected $dates = [ 'created_at', 'updated_at', 'deleted_at', ]; protected $fillable = [ 'principal_id', 'product_sku', 'product_name', 'description', 'created_at', 'updated_at', 'deleted_at', ]; protected $encryptable = [ 'product_sku','product_sku','product_name','description' ]; public function categories() { return $this->belongsToMany(ProductCategory::class); } public function tags() { return $this->belongsToMany(ProductTag::class); } public function getPhotoAttribute() { // $file = $this->getMedia('photo')->last(); $file = ''; if ($file) { $file->url = $file->getUrl(); $file->thumbnail = $file->getUrl('thumb'); $file->preview = $file->getUrl('preview'); } return $file; } protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); } public function license(){ return $this->hasMany(License::class); } public function principals(){ return $this->belongsTo(Principal::class,'principal_id'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка