Added email and password reset

This commit is contained in:
Deon George
2018-08-07 14:26:33 +10:00
parent 46db6537d6
commit a99834a6d1
21 changed files with 2273 additions and 4096 deletions

View File

@@ -39,31 +39,54 @@ class Site extends Model
return NULL;
}
$detail = $this->details->where('key',$key)->first();
$detail = $this->getSiteDetailValue($key);
if ($detail) {
return $detail->value;
}
return $detail->exists ? $detail->value : $this->getDefaultValue($key);
}
// Suppress some default values
$optional = [
'block_quotes',
'clients',
'page_tabs',
'services',
'site_description',
'site_fax',
private function getDefaultValue($key)
{
$okblank = [
'site_address2',
'site_slider',
'steps',
'testimonials',
'site_fax',
'social',
'top_menu'
];
if (in_array($key,$optional))
return '';
if (! in_array($key,$okblank))
Log::alert('Returning Default Value for Key:',['key'=>$key]);
Log::alert('Calling unknown Site Key:',['key'=>$key]);
return array_get($this->_sampledata(),$key);
// Suppress some default values
$default = [
'block_quotes' => '',
'clients' => '',
'page_tabs' => '',
'services' => '',
'site_description' => '',
'site_fax' => '',
'site_address2' => '',
'site_slider' => '',
'social' => [],
'steps' => '',
'testimonials' => '',
'top_menu' => [],
];
return array_get($default,$key);
}
public function getSiteLogoAttribute()
{
$return = $this->getSiteDetailValue('site_logo')->value;
return $return ? 'storage/'.$return : '/image/generic/150/20/fff';
}
private function getSiteDetailValue($key)
{
$return = $this->details->where('key',$key)->first();
return $return ?: (new SiteDetails);
}
/**
@@ -169,10 +192,7 @@ class Site extends Model
//'button'=>['text'=>'Purchase Now','url'=>'#'],
],
],
'site'=>[
'id'=>NULL,
'logo'=>route('image',['width'=>128,'height'=>32,'color'=>'eee']),
],
'site_logo'=>route('image',['width'=>128,'height'=>32,'color'=>'eee']),
'site_address1'=>'Building Name',
'site_address2'=>NULL,
'site_city'=>'City',
@@ -237,7 +257,7 @@ class Site extends Model
public function sample()
{
return $this->forceFill(array_get($this->_sampledata(),'site'));
return $this->forceFill($this->_sampledata());
}
public function aboutus()
@@ -279,9 +299,4 @@ class Site extends Model
return join("\n",$this->_address());
}
}
public function logo_url()
{
return url($this->logo ? $this->logo : '/image/generic/150/20/fff');
}
}
}