Merge branch 'authentication' into user_management
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\User;
|
||||
use Validator;
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class Dashboard extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Class Login
|
||||
*
|
||||
* @package App\Http\Controllers\Admin
|
||||
*
|
||||
* @todo use trait ThrottlesLogins for disabling brutal-force password cracking
|
||||
*/
|
||||
class Login extends Controller
|
||||
{
|
||||
/**
|
||||
* @param array $data
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:users',
|
||||
'password' => 'required|confirmed|min:6',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*/
|
||||
public function postLogin(Request $request)
|
||||
{
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
+16
-4
@@ -11,7 +11,6 @@
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Routes
|
||||
@@ -23,8 +22,21 @@
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
Route::get('/test', 'TestController@showIndex');
|
||||
Route::get('login', function () {
|
||||
return view('admin.loginForm.form');
|
||||
});
|
||||
|
||||
// POST methods
|
||||
Route::post('admin/login', 'Admin\Login@postLogin')
|
||||
->name('login');
|
||||
});
|
||||
|
||||
// list of admin routes
|
||||
Route::group([
|
||||
'middleware' => ['auth'],
|
||||
'namespace' => 'Admin',
|
||||
'prefix' => 'admin'
|
||||
], function () {
|
||||
Route::get('/', 'Dashboard@getIndex');
|
||||
});
|
||||
|
||||
@@ -23,5 +23,13 @@ class User extends Model
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class GlobalViewDataProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
view()->share('something', 'some value');
|
||||
view()->share('vendorName', 'ja s.r.o.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user