WIP: Standard backend theme page and login
Signed-off-by: Deon George <deon@leenooks.net>
This commit is contained in:
@@ -25,6 +25,8 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
return view('home');
|
||||
return view('home',[
|
||||
'page_title'=>'Dashboard',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
26
app/Models/Country.php
Normal file
26
app/Models/Country.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
public $timestamps = FALSE;
|
||||
|
||||
/**
|
||||
* The currency this country belongs to
|
||||
*/
|
||||
public function currency()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Currency');
|
||||
}
|
||||
|
||||
/**
|
||||
* The accounts in this country
|
||||
*/
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('App\User');
|
||||
}
|
||||
}
|
18
app/Models/Currency.php
Normal file
18
app/Models/Currency.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Currency extends Model
|
||||
{
|
||||
public $timestamps = FALSE;
|
||||
|
||||
/**
|
||||
* The accounts in this country
|
||||
*/
|
||||
public function countries()
|
||||
{
|
||||
return $this->hasMany('App\Models\Country');
|
||||
}
|
||||
}
|
18
app/Models/Old/Account.php
Normal file
18
app/Models/Old/Account.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Old;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Account extends Model
|
||||
{
|
||||
protected $table = 'ab_account';
|
||||
|
||||
/**
|
||||
* The country this account belongs to
|
||||
*/
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Old\Country');
|
||||
}
|
||||
}
|
18
app/Models/Old/Country.php
Normal file
18
app/Models/Old/Country.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Old;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
protected $table = 'ab_country';
|
||||
|
||||
/**
|
||||
* The currency this country belongs to
|
||||
*/
|
||||
public function currency()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Old\Currency');
|
||||
}
|
||||
}
|
10
app/Models/Old/Currency.php
Normal file
10
app/Models/Old/Currency.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Old;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Currency extends Model
|
||||
{
|
||||
protected $table = 'ab_currency';
|
||||
}
|
@@ -6,8 +6,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Site extends Model
|
||||
{
|
||||
protected $table = 'site';
|
||||
|
||||
protected $casts = [
|
||||
'address'=>'array',
|
||||
];
|
||||
|
66
app/User.php
66
app/User.php
@@ -2,49 +2,31 @@
|
||||
|
||||
namespace App;
|
||||
|
||||
use Laravel\Spark\User as SparkUser;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends SparkUser
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
];
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
'authy_id',
|
||||
'country_code',
|
||||
'phone',
|
||||
'card_brand',
|
||||
'card_last_four',
|
||||
'card_country',
|
||||
'billing_address',
|
||||
'billing_address_line_2',
|
||||
'billing_city',
|
||||
'billing_zip',
|
||||
'billing_country',
|
||||
'extra_billing_information',
|
||||
];
|
||||
/**
|
||||
* The country this user belongs to
|
||||
*/
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Country');
|
||||
}
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'trial_ends_at' => 'datetime',
|
||||
'uses_two_factor_auth' => 'boolean',
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Only query active categories
|
||||
*/
|
||||
public function scopeActive()
|
||||
{
|
||||
return $this->where('active',TRUE);
|
||||
}
|
||||
|
||||
public function getNameAttribute($value)
|
||||
{
|
||||
return $this->firstname.' '.$this->lastname;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user