Permalink
Browse files

Update base directories

  • Loading branch information...
1 parent b15d3ef commit 4e4f026e7d613de12446269058a5d446982e6e67 Ryan Thompson committed Aug 25, 2016
Showing with 915 additions and 282 deletions.
  1. +12 −12 Gulpfile.js
  2. +0 −33 app/Console/Commands/Inspire.php
  3. +13 −3 app/Console/Kernel.php
  4. +0 −8 app/Events/Event.php
  5. +29 −8 app/Exceptions/Handler.php
  6. +32 −0 app/Http/Controllers/Auth/ForgotPasswordController.php
  7. +39 −0 app/Http/Controllers/Auth/LoginController.php
  8. +17 −11 app/Http/Controllers/Auth/{AuthController.php → RegisterController.php}
  9. +2 −2 app/Http/Controllers/Auth/{PasswordController.php → ResetPasswordController.php}
  10. +3 −2 app/Http/Controllers/Controller.php
  11. +30 −5 app/Http/Kernel.php
  12. +0 −47 app/Http/Middleware/Authenticate.php
  13. +4 −21 app/Http/Middleware/RedirectIfAuthenticated.php
  14. +0 −10 app/Http/Requests/Request.php
  15. +0 −12 app/Http/routes.php
  16. +0 −21 app/Jobs/Job.php
  17. 0 app/Listeners/.gitkeep
  18. +30 −0 app/Providers/AuthServiceProvider.php
  19. +26 −0 app/Providers/BroadcastServiceProvider.php
  20. +4 −5 app/Providers/EventServiceProvider.php
  21. +44 −9 app/Providers/RouteServiceProvider.php
  22. +11 −17 app/User.php
  23. +3 −3 artisan
  24. +7 −7 bootstrap/app.php
  25. +1 −2 composer.json
  26. +38 −4 config/app.php
  27. +23 −0 database/factories/ModelFactory.php
  28. +11 −15 database/seeds/DatabaseSeeder.php
  29. +13 −2 package.json
  30. +4 −7 public/index.php
  31. +20 −0 resources/assets/js/app.js
  32. +45 −0 resources/assets/js/bootstrap.js
  33. +23 −0 resources/assets/js/components/Example.vue
  34. +9 −0 resources/assets/sass/app.scss
  35. +37 −0 resources/assets/sass/variables.scss
  36. +19 −0 resources/lang/en/auth.php
  37. +19 −0 resources/lang/en/pagination.php
  38. +22 −0 resources/lang/en/passwords.php
  39. +115 −0 resources/lang/en/validation.php
  40. +47 −0 resources/views/errors/503.blade.php
  41. +1 −0 resources/views/vendor/.gitkeep
  42. +91 −0 resources/views/welcome.blade.php
  43. +18 −0 routes/api.php
  44. +18 −0 routes/console.php
  45. +16 −0 routes/web.php
  46. +0 −1 storage/.gitignore
  47. +15 −12 tests/ExampleTest.php
  48. +4 −3 tests/TestCase.php
View
@@ -1,19 +1,19 @@
-var elixir = require('laravel-elixir');
+const elixir = require('laravel-elixir');
+
+require('laravel-elixir-vue');
/*
- |----------------------------------------------------------------
- | Have a Drink!
- |----------------------------------------------------------------
+ |--------------------------------------------------------------------------
+ | Elixir Asset Management
+ |--------------------------------------------------------------------------
|
- | Elixir provides a clean, fluent API for defining some basic
- | Gulp tasks for your Laravel application. Elixir supports
- | several common CSS, JavaScript and even testing tools!
+ | Elixir provides a clean, fluent API for defining some basic Gulp tasks
+ | for your Laravel application. By default, we are compiling the Sass
+ | file for our application, as well as publishing vendor resources.
|
*/
-elixir(function(mix) {
- mix.sass("bootstrap.scss")
- .routes()
- .events()
- .phpUnit();
+elixir(mix => {
+ mix.sass('app.scss')
+ .webpack('app.js');
});
@@ -1,33 +0,0 @@
-<?php
-
-namespace App\Console\Commands;
-
-use Illuminate\Console\Command;
-use Illuminate\Foundation\Inspiring;
-
-class Inspire extends Command
-{
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'inspire';
-
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'Display an inspiring quote';
-
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
- }
-}
@@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
- \App\Console\Commands\Inspire::class,
+ //
];
/**
@@ -24,7 +24,17 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
- $schedule->command('inspire')
- ->hourly();
+ // $schedule->command('inspire')
+ // ->hourly();
+ }
+
+ /**
+ * Register the Closure based commands for the application.
+ *
+ * @return void
+ */
+ protected function commands()
+ {
+ require base_path('routes/console.php');
}
}
@@ -1,8 +0,0 @@
-<?php
-
-namespace App\Events;
-
-abstract class Event
-{
- //
-}
@@ -3,7 +3,7 @@
namespace App\Exceptions;
use Exception;
-use Symfony\Component\HttpKernel\Exception\HttpException;
+use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
@@ -14,31 +14,52 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
- HttpException::class,
+ \Illuminate\Auth\AuthenticationException::class,
+ \Illuminate\Auth\Access\AuthorizationException::class,
+ \Symfony\Component\HttpKernel\Exception\HttpException::class,
+ \Illuminate\Database\Eloquent\ModelNotFoundException::class,
+ \Illuminate\Session\TokenMismatchException::class,
+ \Illuminate\Validation\ValidationException::class,
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
- * @param \Exception $e
+ * @param \Exception $exception
* @return void
*/
- public function report(Exception $e)
+ public function report(Exception $exception)
{
- return parent::report($e);
+ parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
- * @param \Exception $e
+ * @param \Exception $exception
* @return \Illuminate\Http\Response
*/
- public function render($request, Exception $e)
+ public function render($request, Exception $exception)
{
- return parent::render($request, $e);
+ return parent::render($request, $exception);
+ }
+
+ /**
+ * Convert an authentication exception into an unauthenticated response.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Illuminate\Auth\AuthenticationException $exception
+ * @return \Illuminate\Http\Response
+ */
+ protected function unauthenticated($request, AuthenticationException $exception)
+ {
+ if ($request->expectsJson()) {
+ return response()->json(['error' => 'Unauthenticated.'], 401);
+ }
+
+ return redirect()->guest('login');
}
}
@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
+
+class ForgotPasswordController extends Controller
+{
+ /*
+ |--------------------------------------------------------------------------
+ | Password Reset Controller
+ |--------------------------------------------------------------------------
+ |
+ | This controller is responsible for handling password reset emails and
+ | includes a trait which assists in sending these notifications from
+ | your application to your users. Feel free to explore this trait.
+ |
+ */
+
+ use SendsPasswordResetEmails;
+
+ /**
+ * Create a new controller instance.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $this->middleware('guest');
+ }
+}
@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use Illuminate\Foundation\Auth\AuthenticatesUsers;
+
+class LoginController extends Controller
+{
+ /*
+ |--------------------------------------------------------------------------
+ | Login Controller
+ |--------------------------------------------------------------------------
+ |
+ | This controller handles authenticating users for the application and
+ | redirecting them to your home screen. The controller uses a trait
+ | to conveniently provide its functionality to your applications.
+ |
+ */
+
+ use AuthenticatesUsers;
+
+ /**
+ * Where to redirect users after login / registration.
+ *
+ * @var string
+ */
+ protected $redirectTo = '/home';
+
+ /**
+ * Create a new controller instance.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $this->middleware('guest', ['except' => 'logout']);
+ }
+}
@@ -5,32 +5,38 @@
use App\User;
use Validator;
use App\Http\Controllers\Controller;
-use Illuminate\Foundation\Auth\ThrottlesLogins;
-use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
+use Illuminate\Foundation\Auth\RegistersUsers;
-class AuthController extends Controller
+class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
- | Registration & Login Controller
+ | Register Controller
|--------------------------------------------------------------------------
|
- | This controller handles the registration of new users, as well as the
- | authentication of existing users. By default, this controller uses
- | a simple trait to add these behaviors. Why don't you explore it?
+ | This controller handles the registration of new users as well as their
+ | validation and creation. By default this controller uses a trait to
+ | provide this functionality without requiring any additional code.
|
*/
- use AuthenticatesAndRegistersUsers, ThrottlesLogins;
+ use RegistersUsers;
/**
- * Create a new authentication controller instance.
+ * Where to redirect users after login / registration.
+ *
+ * @var string
+ */
+ protected $redirectTo = '/home';
+
+ /**
+ * Create a new controller instance.
*
* @return void
*/
public function __construct()
{
- $this->middleware('guest', ['except' => 'getLogout']);
+ $this->middleware('guest');
}
/**
@@ -44,7 +50,7 @@ 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',
+ 'password' => 'required|min:6|confirmed',
]);
}
@@ -5,7 +5,7 @@
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
-class PasswordController extends Controller
+class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
@@ -21,7 +21,7 @@ class PasswordController extends Controller
use ResetsPasswords;
/**
- * Create a new password controller instance.
+ * Create a new controller instance.
*
* @return void
*/
@@ -5,8 +5,9 @@
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-abstract class Controller extends BaseController
+class Controller extends BaseController
{
- use DispatchesJobs, ValidatesRequests;
+ use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
View
@@ -9,23 +9,48 @@ class Kernel extends HttpKernel
/**
* The application's global HTTP middleware stack.
*
+ * These middleware are run during every request to your application.
+ *
* @var array
*/
protected $middleware = [
- \App\Http\Middleware\EncryptCookies::class,
- \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
- \Illuminate\Session\Middleware\StartSession::class,
- \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
+ ];
+
+ /**
+ * The application's route middleware groups.
+ *
+ * @var array
+ */
+ protected $middlewareGroups = [
+ 'web' => [
+ \App\Http\Middleware\EncryptCookies::class,
+ \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
+ \Illuminate\Session\Middleware\StartSession::class,
+ \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+ \App\Http\Middleware\VerifyCsrfToken::class,
+ \Illuminate\Routing\Middleware\SubstituteBindings::class,
+ ],
+
+ 'api' => [
+ 'throttle:60,1',
+ 'bindings',
+ ],
];
/**
* The application's route middleware.
*
+ * These middleware may be assigned to groups or used individually.
+ *
* @var array
*/
protected $routeMiddleware = [
- 'auth' => \App\Http\Middleware\Authenticate::class,
+ 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
+ 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
+ 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
+ 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
];
}
Oops, something went wrong.

0 comments on commit 4e4f026

Please sign in to comment.