Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Exception $e
*
* @return void
*/
public function report(Exception $e)
Expand All @@ -32,8 +33,9 @@ public function report(Exception $e)
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Illuminate\Http\Request $request
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
Expand Down
10 changes: 6 additions & 4 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers;

use Response;

class AdminController extends Controller
{

/**
* Create a new password controller instance.
*/
Expand Down Expand Up @@ -43,6 +43,7 @@ public function profile()
public function lock()
{
$this->theme->layout('blank');

return $this->theme->of('admin::user.lock')->render();
}

Expand All @@ -66,11 +67,11 @@ public function reports()
return $this->theme->of('admin::general.reports')->render();
}


/**
* Return success message.
*
* @param int $id
* @param int $id
*
* @return Response
*/
public function error($message, $status = 400)
Expand All @@ -81,7 +82,8 @@ public function error($message, $status = 400)
/**
* Return error message.
*
* @param int $id
* @param int $id
*
* @return Response
*/
public function success($message, $status = 201)
Expand Down
29 changes: 13 additions & 16 deletions app/Http/Controllers/Auth/AdminAuthController.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\User as UserModal;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AdminAuthController extends Controller
{
Expand All @@ -24,18 +25,15 @@ class AdminAuthController extends Controller
use AuthenticatesAndRegistersUsers, ThrottlesLogins;

/**
* Redirect path after login or register
*
* Redirect path after login or register.
*/
protected $redirectPath = '/admin';

/**
* Redirect path after unsucessful attempt.
*
*/
protected $loginPath = 'admin/login';


/**
* Create a new password controller instance.
*/
Expand All @@ -46,7 +44,7 @@ public function __construct()
}

/**
* Show the login form
* Show the login form.
*
* @return HTML
*/
Expand All @@ -57,18 +55,18 @@ public function getLogin()
return $this->theme->of('admin::user.login')->render();
}


/**
* Remove the specified resource from storage.
*
* @param int $id
* @param int $id
*
* @return mixed
*/
public function getLogout()
{
User::logout();
event('user.logout');

return redirect()->to($this->loginPath);
}

Expand All @@ -92,8 +90,8 @@ public function getRegister()
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|min:6',
]);
}
Expand All @@ -108,15 +106,14 @@ protected function validator(array $data)
protected function create(array $data)
{
$user = UserModal::create([
'name' => $data['name'],
'email' => $data['email'],
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'active' => 0,
'active' => 0,
]);

User::attachRole($user->id, 'admin');

return $user;
}

}
8 changes: 5 additions & 3 deletions app/Http/Controllers/Auth/AdminPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,25 @@ public function __construct()
public function getEmail()
{
$this->theme->layout('blank');

return $this->theme->of('admin::user.password')->render();
}

/**
* Display the password reset view for the given token.
*
* @param string $token
* @param string $token
*
* @return \Illuminate\Http\Response
*/
public function getReset($token = null)
{
if (is_null($token)) {
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}

$this->theme->layout('blank');

return $this->theme->of('admin::user.reset', compact('token'))->render();
}

}
14 changes: 7 additions & 7 deletions app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use App\User;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Validator;

class AuthController extends Controller
{
Expand Down Expand Up @@ -41,8 +41,8 @@ public function __construct()
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',
]);
}
Expand All @@ -57,8 +57,8 @@ protected function validator(array $data)
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
Expand Down
19 changes: 10 additions & 9 deletions app/Http/Controllers/Auth/UserAuthController.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

namespace App\Http\Controllers\Auth;

use User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use User;
use Validator;

class UserAuthController extends Controller
{
Expand All @@ -23,7 +24,7 @@ class UserAuthController extends Controller
use AuthenticatesAndRegistersUsers, ThrottlesLogins;

/**
* Redirect path after login or register
* Redirect path after login or register.
*/
protected $redirectPath = '/home';

Expand All @@ -48,10 +49,10 @@ public function getLogin()
if (view()->exists('auth.authenticate')) {
return view('auth.authenticate');
}

return $this->theme->of('public::user.login')->render();
}


/**
* Remove the specified resource from storage.
*
Expand Down Expand Up @@ -87,8 +88,8 @@ public function getRegister()
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|min:6',
]);
}
Expand All @@ -103,8 +104,8 @@ protected function validator(array $data)
protected function create(array $data)
{
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/UserPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ public function getEmail()
/**
* Display the password reset view for the given token.
*
* @param string $token
* @param string $token
*
* @return \Illuminate\Http\Response
*/
public function getReset($token = null)
{
if (is_null($token)) {
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}

return $this->theme->of('public::user.reset', compact('token'))->render();
}

}
7 changes: 3 additions & 4 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

namespace App\Http\Controllers;

use Former\Facades\Former;
use Teepluss\Theme\Facades\Theme;
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;
use Teepluss\Theme\Facades\Theme;

abstract class Controller extends BaseController
{
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace App\Http\Controllers;

use Page;

/**
*
* @package Lavalite
*/
class PublicController extends Controller
{
Expand All @@ -32,6 +32,7 @@ public function home()
$this->theme->setDescription($data['page']->description);

$this->theme->layout('home');

return $this->theme->of('public.home', $data)->render();
}
}
Loading