/
var
/
www
/
html
/
plugin-techloyce
/
Modules
/
Webstores
/
Entities
/
Upload File
HOME
<?php namespace Modules\Webstores\Entities; use Illuminate\Support\Str; use Illuminate\Database\Eloquent\Model; class Webstore extends Model { protected $fillable = [ 'id', 'middleware_uniqid', 'integration_source', 'integration_destination', 'integration_source_app_url', 'integration_destination_app_url', 'source_refresh_token', 'source_access_token', 'source_expires_in', 'source_token_updated_at', 'destination_refresh_token', 'destination_access_token', 'destination_expires_in', 'destination_token_updated_at', 'source_extra_information', 'destination_extra_information', ]; protected $connection = "DB_Webstores"; public $incrementing = false; protected $keyType = 'string'; public static function getMiddlewareUniqueId($source,$destination) { return strtolower($source.'_'.$destination.'_'.uniqid()); } public function setIdAttribute($value) { if(empty($value)) { $this->attributes['id'] = (string)Str::uuid(); } else { $this->attributes['id'] = $value; } } }