Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6c60298e8f | ||
|
41b320a5b9 | ||
|
1096f0e28d | ||
|
b0730b9ed3 | ||
|
163a7f2587 | ||
|
4f2707a374 | ||
|
0ca66c6d1c | ||
|
5833122ab5 |
@@ -10,10 +10,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"igaster/laravel-theme": "^2.0.12",
|
"igaster/laravel-theme": "^2.0.15",
|
||||||
"acacha/user": "^0.2.2",
|
|
||||||
"creativeorange/gravatar": "^1.0",
|
"creativeorange/gravatar": "^1.0",
|
||||||
"orchestra/asset": "^3.6"
|
"orchestra/asset": "^4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
},
|
},
|
||||||
|
@@ -5,6 +5,14 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@if(isset($login_note) AND $login_note)
|
||||||
|
<div class="alert alert-info alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
<h5><i class="icon fa fa-info"></i> NOTE!</h5>
|
||||||
|
{{ $login_note }}
|
||||||
|
</div>
|
||||||
|
@endisset
|
||||||
|
|
||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
<div class="login-logo">
|
<div class="login-logo">
|
||||||
<a>{!! config('app.name_html_long') !!}</a>
|
<a>{!! config('app.name_html_long') !!}</a>
|
||||||
|
@@ -42,4 +42,9 @@
|
|||||||
<!-- CSS Fixes -->
|
<!-- CSS Fixes -->
|
||||||
<link rel="stylesheet" href="{{ asset('/css/fixes.css') }}">
|
<link rel="stylesheet" href="{{ asset('/css/fixes.css') }}">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if(file_exists('css/custom.css'))
|
||||||
|
<!-- Custom CSS -->
|
||||||
|
<link rel="stylesheet" href="{{ asset('/css/custom.css') }}">
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
@@ -15,6 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<a href="{{ url('login') }}" class="d-block">{{ $user->name ?: 'Nobody' }}</a>
|
<a href="{{ url('login') }}" class="d-block">{{ $user->name ?: 'Nobody' }}</a>
|
||||||
|
@isset($user->lastlogin)<a span="d-block"><small><span style="color: #747474;">Last On:</span> {{ $user->lastlogin->format('Y-m-d H:i') }}</small></a>@endisset
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
29
src/GuestUser.php
Normal file
29
src/GuestUser.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Leenooks;
|
||||||
|
|
||||||
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
|
|
||||||
|
class GuestUser extends Authenticatable
|
||||||
|
{
|
||||||
|
use Notifiable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'name', 'email', 'password',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be hidden for arrays.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $hidden = [
|
||||||
|
'password', 'remember_token',
|
||||||
|
];
|
||||||
|
}
|
27
src/Http/Middleware/GuestUser.php
Normal file
27
src/Http/Middleware/GuestUser.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Leenooks\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class GuestUser
|
||||||
|
* @package Leenooks\Laravel\Http\Middleware
|
||||||
|
*/
|
||||||
|
class GuestUser
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param \Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle($request, Closure $next)
|
||||||
|
{
|
||||||
|
view()->share('loggedin',auth()->check());
|
||||||
|
view()->share('user', auth()->user() ?: new \Leenooks\GuestUser);
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Leenooks\Providers;
|
namespace Leenooks\Providers;
|
||||||
|
|
||||||
|
use Leenooks\Http\Middleware\GuestUser;
|
||||||
use Illuminate\Routing\Router;
|
use Illuminate\Routing\Router;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
@@ -21,12 +22,15 @@ class LeenooksServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot(Router $router)
|
public function boot(Router $router)
|
||||||
{
|
{
|
||||||
|
$router->pushMiddlewareToGroup('web',GuestUser::class);
|
||||||
|
|
||||||
$this->loadViewsFrom($this->_path.'/resources/themes/adminlte/views/', 'adminlte');
|
$this->loadViewsFrom($this->_path.'/resources/themes/adminlte/views/', 'adminlte');
|
||||||
$this->loadTranslationsFrom($this->_path.'/resources/themes/adminlte/lang/', 'adminlte_lang');
|
$this->loadTranslationsFrom($this->_path.'/resources/themes/adminlte/lang/', 'adminlte_lang');
|
||||||
|
|
||||||
// Enable a recusive() collection function so that we can just arrives in config/*.php
|
// Enable a Collect::recursive() function
|
||||||
\Illuminate\Support\Collection::macro('recursive', function () {
|
\Illuminate\Support\Collection::macro('recursive', function () {
|
||||||
return $this->map(function ($value) {
|
return $this->map(function ($value) {
|
||||||
|
|
||||||
if (is_array($value) || is_object($value)) {
|
if (is_array($value) || is_object($value)) {
|
||||||
return collect($value)->recursive();
|
return collect($value)->recursive();
|
||||||
}
|
}
|
||||||
@@ -56,16 +60,11 @@ class LeenooksServiceProvider extends ServiceProvider
|
|||||||
public function views()
|
public function views()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
$this->_path.'/resources/views/auth' =>
|
$this->_path.'/resources/views/auth' => resource_path('views/vendor/adminlte/auth'),
|
||||||
resource_path('views/vendor/adminlte/auth'),
|
$this->_path.'/resources/views/errors' => resource_path('views/vendor/adminlte/errors'),
|
||||||
$this->_path.'/resources/views/errors' =>
|
$this->_path.'/resources/views/layouts' => resource_path('views/vendor/adminlte/layouts'),
|
||||||
resource_path('views/vendor/adminlte/errors'),
|
$this->_path.'/resources/views/home.blade.php' => resource_path('views/vendor/adminlte/home.blade.php'),
|
||||||
$this->_path.'/resources/views/layouts' =>
|
$this->_path.'/resources/views/welcome.blade.php' => resource_path('views/welcome.blade.php'),
|
||||||
resource_path('views/vendor/adminlte/layouts'),
|
|
||||||
$this->_path.'/resources/views/home.blade.php' =>
|
|
||||||
resource_path('views/vendor/adminlte/home.blade.php'),
|
|
||||||
$this->_path.'/resources/views/welcome.blade.php' =>
|
|
||||||
resource_path('views/welcome.blade.php'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user