Skip to content

Commit 511982a

Browse files
committed
Merge branch 'dev'
2 parents 0e16054 + 5453812 commit 511982a

File tree

7 files changed

+85
-129
lines changed

7 files changed

+85
-129
lines changed

README.md

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# AdminLTE template Laravel 5 package
2-
A Laravel 5 package that switch default Laravel scaffolding / boilerplate to AdminLTE template with Bootstrap 3.0 and Pratt Landing Page
1+
# AdminLTE template Laravel package
2+
A Laravel package that switch default Laravel scaffolding / boilerplate to AdminLTE template with Bootstrap 3.0 and Pratt Landing Page
33

44
See demo here:
55

@@ -17,31 +17,12 @@ If you are looking for the Laravel 4 version, use 0.1.5 version/tag and see [OLD
1717
[![StyleCI](https://styleci.io/repos/35628567/shield)](https://styleci.io/repos/35628567)
1818
[![Build Status](https://travis-ci.org/acacha/adminlte-laravel.svg?branch=master)](https://travis-ci.org/acacha/adminlte-laravel)
1919

20-
# Installation & use
21-
22-
**So easy to install!** Install globally with composer:
23-
24-
```bash
25-
composer global require "acacha/adminlte-laravel-installer"
26-
```
27-
28-
And convert any Laravel installation to AdminLTE/Pratt with:
29-
30-
```bash
31-
laravel new laravel-with-admin-lte
32-
cd laravel-with-admin-lte
33-
adminlte-laravel install
34-
```
35-
Enjoy! If you wish you can use [llum](https://github.com/acacha/llum) to start your app:
20+
# Installation
3621

3722
```bash
38-
llum boot
23+
composer require "acacha/admin-lte-template-laravel"
3924
```
4025

41-
To start using you Laravel with AdminLTE. Llum will configure database (sqlite),execute migrations, install devtools and serve for you.
42-
43-
More info about llum commands in Github [Acacha/llum](https://github.com/acacha/llum).
44-
4526
# Requirements
4627

4728
This packages use (no need to install):
@@ -50,12 +31,10 @@ This packages use (no need to install):
5031
* [Laravel](http://laravel.com/)
5132
* [AdminLTE](https://github.com/almasaeed2010/AdminLTE). You can see and AdminLTE theme preview at: http://almsaeedstudio.com/preview/
5233
* [Pratt](http://blacktie.co/demo/pratt/). Pratt Landing Page
53-
* [Acacha/user](https://github.com/acacha/user): providing boosted Laravel Users. This could be optional through configuration.
5434
* [acacha/helpers](https://github.com/acacha/helpers) : Extra helpers for Laravel provided by acacha.
5535
* [creativeorange/gravatar](https://github.com/creativeorange/gravatar): Gravatar support for user's profile images. This could be optional through configuration.
5636
* [league/flysystem](https://github.com/thephpleague/flysystem) : Filesystem support.
5737
* [acacha/forms](https://github.com/acacha/forms) : Javascript Form objects implementation.
58-
* [acacha/llum](https://github.com/acacha/llum). Easy Laravel packages installation (and other tasks). Used to modify config/app.php file without using stubs (so you changes to this file would be respected)
5938
* [thephpleague/skeleton](https://github.com/thephpleague/skeleton). This package use/has been adapted to use the phpleague skeleton.
6039
* Acacha llum requires GNU sed. on MAC OS install GNU sed with:
6140

@@ -88,21 +67,9 @@ Please be sure to check you environment.
8867
## Optional requirements
8968
* [Laravel menu](https://github.com/spatie/laravel-menu): only used with command adminlte:menu that replaces default adminlte menu with a menu with spatie/laravel-menu support.
9069

91-
## Laravel 5.8
92-
93-
This package works smoothly with Laravel 5.8 with 6.2 version.
94-
95-
## Laravel 5.7
96-
97-
This package works smoothly with Laravel 5.7 with 6.1 version.
98-
99-
## Laravel 5.6
100-
101-
This package works smoothly with Laravel 5.6 with 6.1 version.
102-
103-
## Laravel 5.5
70+
## Laravel 5.8 and older
10471

105-
This package now use new Laravel 5.5 feature Package Auto Discover.
72+
This package works smoothly with Laravel 5.x with 6.x version
10673

10774
## Laravel 5.4
10875

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
],
1515
"require": {
1616
"php": "^7.1.3",
17+
"creativeorange/gravatar": "~1.0",
18+
"laravel/framework": "6.*",
1719
"acacha/filesystem": "^0.1.2",
1820
"acacha/helpers": "^0.1.4",
19-
"acacha/user": "~0.2",
20-
"creativeorange/gravatar": "~1.0",
21-
"laravel/framework": "^5.4",
2221
"league/flysystem": "^1.0"
2322
},
2423
"require-dev": {

src/GuestUser.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace Acacha\AdminLTETemplateLaravel;
4+
5+
use Illuminate\Contracts\Auth\MustVerifyEmail;
6+
use Illuminate\Foundation\Auth\User as Authenticatable;
7+
use Illuminate\Notifications\Notifiable;
8+
9+
class GuestUser extends Authenticatable
10+
{
11+
use Notifiable;
12+
13+
/**
14+
* The attributes that are mass assignable.
15+
*
16+
* @var array
17+
*/
18+
protected $fillable = [
19+
'name', 'email', 'password',
20+
];
21+
22+
23+
/**
24+
* The attributes that should be hidden for arrays.
25+
*
26+
* @var array
27+
*/
28+
protected $hidden = [
29+
'password', 'remember_token',
30+
];
31+
32+
/**
33+
* The attributes that should be cast to native types.
34+
*
35+
* @var array
36+
*/
37+
protected $casts = [
38+
'email_verified_at' => 'datetime',
39+
];
40+
}

src/Http/Middleware/GuestUser.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Acacha\AdminLTETemplateLaravel\Http\Middleware;
4+
5+
use Closure;
6+
7+
/**
8+
* Class GuestUser
9+
* @package Acacha\User\Http\Middleware
10+
*/
11+
class GuestUser
12+
{
13+
/**
14+
* Handle an incoming request.
15+
*
16+
* @param \Illuminate\Http\Request $request
17+
* @param \Closure $next
18+
* @return mixed
19+
*/
20+
public function handle($request, Closure $next)
21+
{
22+
view()->share('signedIn', auth()->check());
23+
view()->share('user', auth()->user() ?: new \Acacha\AdminLTETemplateLaravel\GuestUser);
24+
25+
return $next($request);
26+
}
27+
}

src/Providers/AdminLTETemplateServiceProvider.php

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
namespace Acacha\AdminLTETemplateLaravel\Providers;
44

5-
use Acacha\AdminLTETemplateLaravel\Facades\AdminLTE;
6-
use Acacha\User\Providers\GuestUserServiceProvider;
5+
use Illuminate\Routing\Router;
6+
use Illuminate\Support\ServiceProvider;
77
use Creativeorange\Gravatar\Facades\Gravatar;
8-
use Creativeorange\Gravatar\GravatarServiceProvider;
98
use Illuminate\Console\DetectsApplicationNamespace;
10-
use Illuminate\Support\ServiceProvider;
9+
use Acacha\AdminLTETemplateLaravel\Facades\AdminLTE;
10+
use Creativeorange\Gravatar\GravatarServiceProvider;
11+
use Acacha\AdminLTETemplateLaravel\Http\Middleware\GuestUser;
1112

1213
/**
1314
* Class AdminLTETemplateServiceProvider.
@@ -52,23 +53,12 @@ public function register()
5253
$this->registerGravatarServiceProvider();
5354
}
5455

55-
if (config('adminlte.guestuser', true)) {
56-
$this->registerGuestUserProvider();
57-
}
5856
if (config('auth.providers.users.field', 'email') === 'username' &&
5957
config('adminlte.add_nullable_username', true)) {
6058
$this->loadMigrationsFrom(ADMINLTETEMPLATE_PATH .'/database/migrations/username_login');
6159
}
6260
}
6361

64-
/**
65-
* Register Guest User Provider.
66-
*/
67-
protected function registerGuestUserProvider()
68-
{
69-
$this->app->register(GuestUserServiceProvider::class);
70-
}
71-
7262
/**
7363
* Register Gravatar Service Provider.
7464
*/
@@ -83,8 +73,10 @@ class_alias(Gravatar::class, 'Gravatar');
8373
/**
8474
* Bootstrap the application services.
8575
*/
86-
public function boot()
76+
public function boot(Router $router)
8777
{
78+
$router->pushMiddlewareToGroup('web', GuestUser::class);
79+
8880
if (config('adminlte.install_routes', true)) {
8981
$this->defineRoutes();
9082
}
@@ -255,7 +247,6 @@ private function publishApiRoutes()
255247
private function publishDusk()
256248
{
257249
$this->publishDuskEnvironment();
258-
$this->publishAppServiceProvider();
259250
}
260251

261252
/**
@@ -266,14 +257,6 @@ private function publishDuskEnvironment()
266257
$this->publishes(AdminLTE::duskEnvironment(), 'adminlte');
267258
}
268259

269-
/**
270-
* Publish app/Providers/AppServiceProvider.php file.
271-
*/
272-
private function publishAppServiceProvider()
273-
{
274-
$this->publishes(AdminLTE::appServiceProviderClass(), 'adminlte');
275-
}
276-
277260
/**
278261
* Publish database config files.
279262
*/

src/stubs/AppServiceProvider.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)