restore composer.json, add mysqli extension

This commit is contained in:
2026-04-15 17:02:52 +05:00
commit 77cf56a348
4317 changed files with 1397107 additions and 0 deletions

60
app/Models/SpecialOffer.php Executable file
View File

@@ -0,0 +1,60 @@
<?php
namespace App\Models;
use App\Traits\LogOptionsTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\Storage;
use Spatie\Activitylog\Traits\LogsActivity;
class SpecialOffer extends Model
{
use LogsActivity, LogOptionsTrait;
protected $fillable = [
'name',
'description',
'link',
'image'
];
protected $casts = [
'name' => 'array',
'description' => 'array'
];
protected static $logName = 'special_offer';
protected static $logOnlyDirty = true;
protected static $submitEmptyLogs = false;
protected static $logAttributes = [
'name',
'description',
'link',
'image'
];
public function getName(): string
{
return (string) $this->name[app()->getLocale()] ?? null;
}
public function getDescription(): string
{
return (string) $this->description[app()->getLocale()] ?? null;
}
public function getImage(): string
{
if (!empty($this->image)) {
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
return Storage::temporaryUrl(
$this->image, Date::now()->addMinutes(5)
);
}
return (string) $this->image;
}
return (string) 'images/nophoto.png';
}
}