Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

Commit

Permalink
Merge pull request #11 from Laravel-Backpack/analysis-zDyMgy
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI

[ci skip]
  • Loading branch information
tabacitu committed May 20, 2016
2 parents 27fe38b + 4b569f9 commit c751bd3
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 99 deletions.
25 changes: 13 additions & 12 deletions src/BaseServiceProvider.php
@@ -1,8 +1,9 @@
<?php

namespace Backpack\Base;

use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;

class BaseServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -32,17 +33,17 @@ public function boot()

// PUBLISH FILES
// publish config file
$this->publishes([ __DIR__.'/config/config.php' => config_path('backpack/base.php'), ], 'config');
$this->publishes([__DIR__.'/config/config.php' => config_path('backpack/base.php')], 'config');
// publish lang files
$this->publishes([ __DIR__.'/resources/lang' => resource_path('lang/vendor/backpack'), ], 'lang');
$this->publishes([__DIR__.'/resources/lang' => resource_path('lang/vendor/backpack')], 'lang');
// publish views
$this->publishes([ __DIR__.'/resources/views' => resource_path('views/vendor/backpack/base'), ], 'views');
$this->publishes([__DIR__.'/resources/views' => resource_path('views/vendor/backpack/base')], 'views');
// publish error views
$this->publishes([ __DIR__.'/resources/error_views' => resource_path('views/errors'), ], 'errors');
$this->publishes([__DIR__.'/resources/error_views' => resource_path('views/errors')], 'errors');
// publish public Backpack assets
$this->publishes([ __DIR__.'/public' => public_path('vendor/backpack'), ], 'public');
$this->publishes([__DIR__.'/public' => public_path('vendor/backpack')], 'public');
// publish public AdminLTE assets
$this->publishes([ base_path('vendor/almasaeed2010/adminlte') => public_path('vendor/adminlte'), ], 'adminlte');
$this->publishes([base_path('vendor/almasaeed2010/adminlte') => public_path('vendor/adminlte')], 'adminlte');

// use the vendor configuration file as fallback
$this->mergeConfigFrom(
Expand All @@ -53,13 +54,13 @@ public function boot()
/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @param \Illuminate\Routing\Router $router
*
* @return void
*/
public function setupRoutes(Router $router)
{
$router->group(['namespace' => 'Backpack\Base\app\Http\Controllers'], function($router)
{
$router->group(['namespace' => 'Backpack\Base\app\Http\Controllers'], function ($router) {
require __DIR__.'/app/Http/routes.php';
});
}
Expand All @@ -81,8 +82,8 @@ public function register()

private function registerBase()
{
$this->app->bind('base',function($app){
$this->app->bind('base', function ($app) {
return new Base($app);
});
}
}
}
4 changes: 2 additions & 2 deletions src/SkeletonClass.php
Expand Up @@ -5,15 +5,15 @@
class SkeletonClass
{
/**
* Create a new Skeleton Instance
* Create a new Skeleton Instance.
*/
public function __construct()
{
// constructor body
}

/**
* Friendly welcome
* Friendly welcome.
*
* @param string $phrase Phrase to return
*
Expand Down
6 changes: 1 addition & 5 deletions src/app/Http/Controllers/AdminController.php
Expand Up @@ -2,10 +2,6 @@

namespace Backpack\Base\app\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;
use Prologue\Alerts\Facades\Alert as Alert;

class AdminController extends Controller
{
protected $data = []; // the information we send to the view
Expand All @@ -25,7 +21,7 @@ public function __construct()
*/
public function dashboard()
{
$this->data['title'] = "Dashboard"; // set the page title
$this->data['title'] = 'Dashboard'; // set the page title

return view('backpack::dashboard', $this->data);
}
Expand Down
38 changes: 17 additions & 21 deletions src/app/Http/Controllers/Auth/AuthController.php
Expand Up @@ -3,12 +3,12 @@
namespace Backpack\Base\app\Http\Controllers\Auth;

use App\User;
use Validator;
use Illuminate\Http\Request;
use Backpack\Base\app\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Validator;

class AuthController extends Controller
{
Expand Down Expand Up @@ -47,42 +47,39 @@ public function __construct()
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @param array $data
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
]);
}

/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @param array $data
*
* @return User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}




// -------------------------------------------------------
// Laravel overwrites for loading backpack views
// -------------------------------------------------------



/**
* Show the application login form.
*
Expand All @@ -97,7 +94,7 @@ public function showLoginForm()
return view($view);
}

$this->data['title'] = "Login"; // set the page title
$this->data['title'] = 'Login'; // set the page title

return view('backpack::auth.login', $this->data);
}
Expand All @@ -110,31 +107,30 @@ public function showLoginForm()
public function showRegistrationForm()
{
// if registration is closed, deny access
if (!config('base.registration_open'))
{
if (!config('base.registration_open')) {
abort(403, trans('backpack::base.registration_closed'));
}

if (property_exists($this, 'registerView')) {
return view($this->registerView);
}

$this->data['title'] = "Register"; // set the page title
$this->data['title'] = 'Register'; // set the page title

return view('backpack::auth.register', $this->data);
}

/**
* Handle a registration request for the application.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\Response
*/
public function register(Request $request)
{
// if registration is closed, deny access
if (!config('base.registration_open'))
{
if (!config('base.registration_open')) {
abort(403, trans('backpack::base.registration_closed'));
}

Expand Down
16 changes: 5 additions & 11 deletions src/app/Http/Controllers/Auth/PasswordController.php
Expand Up @@ -5,7 +5,6 @@
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Http\Request;
use Illuminate\Mail\Message;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Password;

Expand Down Expand Up @@ -36,24 +35,18 @@ public function __construct()
$this->middleware('guest');
}




// -------------------------------------------------------
// Laravel overwrites for loading backpack views
// -------------------------------------------------------




/**
* Display the form to request a password reset link.
*
* @return \Illuminate\Http\Response
*/
public function showLinkRequestForm()
{
$this->data['title'] = "Reset password"; // set the page title
$this->data['title'] = 'Reset password'; // set the page title

if (property_exists($this, 'linkRequestView')) {
return view($this->linkRequestView);
Expand All @@ -71,13 +64,14 @@ public function showLinkRequestForm()
*
* If no token is present, display the link request form.
*
* @param \Illuminate\Http\Request $request
* @param string|null $token
* @param \Illuminate\Http\Request $request
* @param string|null $token
*
* @return \Illuminate\Http\Response
*/
public function showResetForm(Request $request, $token = null)
{
$this->data['title'] = "Reset password"; // set the page title
$this->data['title'] = 'Reset password'; // set the page title

if (is_null($token)) {
return $this->getEmail();
Expand Down
6 changes: 3 additions & 3 deletions src/app/Http/Controllers/Controller.php
Expand Up @@ -2,12 +2,12 @@

namespace Backpack\Base\app\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
}
4 changes: 2 additions & 2 deletions src/app/Http/routes.php
Expand Up @@ -2,7 +2,7 @@

// All BackPack routes are placed under the 'admin' prefix, to minimize possible conflicts with your application. This means your login/logout/register urls are also under the 'admin' prefix, so you can have separate logins for users and admins.
Route::group(['middleware' => 'web', 'prefix' => 'admin'], function () {
// Admin authentication routes
// Admin authentication routes
Route::auth();

// Other Backpack\Base routes
Expand All @@ -14,4 +14,4 @@
// The login url is hardcoded in Laravel in a few places, most importantly in the auth middleware. If your application has a different login for users (non-admins), you should consider overwriting this.
Route::get('login', function () {
return redirect('admin/login');
});
});
84 changes: 41 additions & 43 deletions src/config/config.php
Expand Up @@ -2,48 +2,46 @@

return [

/*
|--------------------------------------------------------------------------
| Look & feel customizations
|--------------------------------------------------------------------------
|
| Make it yours.
|
*/

// Project name. Shown in the breadcrumbs and a few other places.
'project_name' => 'Backpack',

// Menu logos
'logo_lg' => '<b>Back</b>pack',
'logo_mini' => '<b>B</b>p',


// Developer or company name. Shown in footer.
'developer_name' => 'Cristian Tabacitu',

// Developer website. Link in footer.
'developer_link' => 'http://tabacitu.ro',

// Show powered by Laravel Backpack in the footer?
'show_powered_by' => true,

// The AdminLTE skin. Affects menu color and primary/secondary colors used throughout the application.
'skin' => 'skin-purple',
// Options: skin-black, skin-blue, skin-purple, skin-red, skin-yellow, skin-green, skin-blue-light, skin-black-light, skin-purple-light, skin-green-light, skin-red-light, skin-yellow-light


/*
|--------------------------------------------------------------------------
| Registration Open
|--------------------------------------------------------------------------
|
| Choose wether new users are allowed to register.
| This will show up the Register button in the menu and allow access to the
| Register functions in AuthController.
|
*/

'registration_open' => true,
/*
|--------------------------------------------------------------------------
| Look & feel customizations
|--------------------------------------------------------------------------
|
| Make it yours.
|
*/

// Project name. Shown in the breadcrumbs and a few other places.
'project_name' => 'Backpack',

// Menu logos
'logo_lg' => '<b>Back</b>pack',
'logo_mini' => '<b>B</b>p',

// Developer or company name. Shown in footer.
'developer_name' => 'Cristian Tabacitu',

// Developer website. Link in footer.
'developer_link' => 'http://tabacitu.ro',

// Show powered by Laravel Backpack in the footer?
'show_powered_by' => true,

// The AdminLTE skin. Affects menu color and primary/secondary colors used throughout the application.
'skin' => 'skin-purple',
// Options: skin-black, skin-blue, skin-purple, skin-red, skin-yellow, skin-green, skin-blue-light, skin-black-light, skin-purple-light, skin-green-light, skin-red-light, skin-yellow-light

/*
|--------------------------------------------------------------------------
| Registration Open
|--------------------------------------------------------------------------
|
| Choose wether new users are allowed to register.
| This will show up the Register button in the menu and allow access to the
| Register functions in AuthController.
|
*/

'registration_open' => true,

];

0 comments on commit c751bd3

Please sign in to comment.