restore composer.json, add mysqli extension
This commit is contained in:
44
app/Models/ContractTemplate.php
Executable file
44
app/Models/ContractTemplate.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
/**
|
||||
* @package App\Models
|
||||
* @property integer $id
|
||||
* @property string $path
|
||||
* @property string $lang
|
||||
* @property string $type
|
||||
*
|
||||
* @method string full_path()
|
||||
*/
|
||||
class ContractTemplate extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'path',
|
||||
'lang',
|
||||
"company",
|
||||
'type',
|
||||
];
|
||||
|
||||
public function full_path(): string
|
||||
{
|
||||
if (!empty($this->path)) {
|
||||
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
|
||||
return Storage::temporaryUrl(
|
||||
$this->path,
|
||||
Date::now()->addMinutes(5)
|
||||
);
|
||||
}
|
||||
return '/' . $this->path;
|
||||
}
|
||||
|
||||
return asset('storage/' . $this->path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user