Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
manelgavalda committed Jul 17, 2020
2 parents 0e16054 + 5453812 commit 511982a
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 129 deletions.
45 changes: 6 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AdminLTE template Laravel 5 package
A Laravel 5 package that switch default Laravel scaffolding / boilerplate to AdminLTE template with Bootstrap 3.0 and Pratt Landing Page
# AdminLTE template Laravel package
A Laravel package that switch default Laravel scaffolding / boilerplate to AdminLTE template with Bootstrap 3.0 and Pratt Landing Page

See demo here:

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

# Installation & use

**So easy to install!** Install globally with composer:

```bash
composer global require "acacha/adminlte-laravel-installer"
```

And convert any Laravel installation to AdminLTE/Pratt with:

```bash
laravel new laravel-with-admin-lte
cd laravel-with-admin-lte
adminlte-laravel install
```
Enjoy! If you wish you can use [llum](https://github.com/acacha/llum) to start your app:
# Installation

```bash
llum boot
composer require "acacha/admin-lte-template-laravel"
```

To start using you Laravel with AdminLTE. Llum will configure database (sqlite),execute migrations, install devtools and serve for you.

More info about llum commands in Github [Acacha/llum](https://github.com/acacha/llum).

# Requirements

This packages use (no need to install):
Expand All @@ -50,12 +31,10 @@ This packages use (no need to install):
* [Laravel](http://laravel.com/)
* [AdminLTE](https://github.com/almasaeed2010/AdminLTE). You can see and AdminLTE theme preview at: http://almsaeedstudio.com/preview/
* [Pratt](http://blacktie.co/demo/pratt/). Pratt Landing Page
* [Acacha/user](https://github.com/acacha/user): providing boosted Laravel Users. This could be optional through configuration.
* [acacha/helpers](https://github.com/acacha/helpers) : Extra helpers for Laravel provided by acacha.
* [creativeorange/gravatar](https://github.com/creativeorange/gravatar): Gravatar support for user's profile images. This could be optional through configuration.
* [league/flysystem](https://github.com/thephpleague/flysystem) : Filesystem support.
* [acacha/forms](https://github.com/acacha/forms) : Javascript Form objects implementation.
* [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)
* [thephpleague/skeleton](https://github.com/thephpleague/skeleton). This package use/has been adapted to use the phpleague skeleton.
* Acacha llum requires GNU sed. on MAC OS install GNU sed with:

Expand Down Expand Up @@ -88,21 +67,9 @@ Please be sure to check you environment.
## Optional requirements
* [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.

## Laravel 5.8

This package works smoothly with Laravel 5.8 with 6.2 version.

## Laravel 5.7

This package works smoothly with Laravel 5.7 with 6.1 version.

## Laravel 5.6

This package works smoothly with Laravel 5.6 with 6.1 version.

## Laravel 5.5
## Laravel 5.8 and older

This package now use new Laravel 5.5 feature Package Auto Discover.
This package works smoothly with Laravel 5.x with 6.x version

## Laravel 5.4

Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
],
"require": {
"php": "^7.1.3",
"creativeorange/gravatar": "~1.0",
"laravel/framework": "6.*",
"acacha/filesystem": "^0.1.2",
"acacha/helpers": "^0.1.4",
"acacha/user": "~0.2",
"creativeorange/gravatar": "~1.0",
"laravel/framework": "^5.4",
"league/flysystem": "^1.0"
},
"require-dev": {
Expand Down
40 changes: 40 additions & 0 deletions src/GuestUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace Acacha\AdminLTETemplateLaravel;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

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',
];

/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}
27 changes: 27 additions & 0 deletions src/Http/Middleware/GuestUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Acacha\AdminLTETemplateLaravel\Http\Middleware;

use Closure;

/**
* Class GuestUser
* @package Acacha\User\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('signedIn', auth()->check());
view()->share('user', auth()->user() ?: new \Acacha\AdminLTETemplateLaravel\GuestUser);

return $next($request);
}
}
33 changes: 8 additions & 25 deletions src/Providers/AdminLTETemplateServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Acacha\AdminLTETemplateLaravel\Providers;

use Acacha\AdminLTETemplateLaravel\Facades\AdminLTE;
use Acacha\User\Providers\GuestUserServiceProvider;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Creativeorange\Gravatar\Facades\Gravatar;
use Creativeorange\Gravatar\GravatarServiceProvider;
use Illuminate\Console\DetectsApplicationNamespace;
use Illuminate\Support\ServiceProvider;
use Acacha\AdminLTETemplateLaravel\Facades\AdminLTE;
use Creativeorange\Gravatar\GravatarServiceProvider;
use Acacha\AdminLTETemplateLaravel\Http\Middleware\GuestUser;

/**
* Class AdminLTETemplateServiceProvider.
Expand Down Expand Up @@ -52,23 +53,12 @@ public function register()
$this->registerGravatarServiceProvider();
}

if (config('adminlte.guestuser', true)) {
$this->registerGuestUserProvider();
}
if (config('auth.providers.users.field', 'email') === 'username' &&
config('adminlte.add_nullable_username', true)) {
$this->loadMigrationsFrom(ADMINLTETEMPLATE_PATH .'/database/migrations/username_login');
}
}

/**
* Register Guest User Provider.
*/
protected function registerGuestUserProvider()
{
$this->app->register(GuestUserServiceProvider::class);
}

/**
* Register Gravatar Service Provider.
*/
Expand All @@ -83,8 +73,10 @@ class_alias(Gravatar::class, 'Gravatar');
/**
* Bootstrap the application services.
*/
public function boot()
public function boot(Router $router)
{
$router->pushMiddlewareToGroup('web', GuestUser::class);

if (config('adminlte.install_routes', true)) {
$this->defineRoutes();
}
Expand Down Expand Up @@ -255,7 +247,6 @@ private function publishApiRoutes()
private function publishDusk()
{
$this->publishDuskEnvironment();
$this->publishAppServiceProvider();
}

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

/**
* Publish app/Providers/AppServiceProvider.php file.
*/
private function publishAppServiceProvider()
{
$this->publishes(AdminLTE::appServiceProviderClass(), 'adminlte');
}

/**
* Publish database config files.
*/
Expand Down
28 changes: 0 additions & 28 deletions src/stubs/AppServiceProvider.php

This file was deleted.

Loading

0 comments on commit 511982a

Please sign in to comment.