Server : Apache System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64 User : tradze ( 1001) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/tradze/public_html/test.tradze.com/app_old/Modules/Accounts/Models/ |
<?php
namespace App\Modules\Accounts\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage;
class Account extends Model
{
use SoftDeletes;
/**
* The database table used by the model.
*
* @var string
*/
protected $table="accounts";
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'user_id',
'company',
'vat_number',
'reg_number',
'addr_postcode',
'addr_city',
'addr_state',
'addr_address',
'phone',
'fax',
'email',
'web_url',
'bank_name',
'bank_account',
'bank_sortcode',
'file_logo',
'file_stamp',
];
/**
* The attributes dates
*
* @var array
*/
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
public function getLogoFileAttribute()
{
$image = '';
if ($this->file_logo){
if (Storage::disk('public_images')->exists($this->file_logo)){
$image = Storage::disk('public_images')->get($this->file_logo);
}
}
return $image;
}
public function getLogoUrlAttribute()
{
$image = '';
if ($this->file_logo){
if (Storage::disk('public_images')->exists($this->file_logo)){
// $image = Storage::disk('public_images')->get($this->file_logo);
$image = url('images/'.$this->file_logo);
}
}
return $image;
}
}