Permalink
Please sign in to comment.
Showing
with
5,590 additions
and 0 deletions.
- +23 −0 .env.example
- +3 −0 .gitattributes
- +5 −0 .gitignore
- +33 −0 app/Console/Commands/Inspire.php
- +30 −0 app/Console/Kernel.php
- +8 −0 app/Events/Event.php
- +50 −0 app/Exceptions/Handler.php
- +72 −0 app/Http/Controllers/Auth/AuthController.php
- +32 −0 app/Http/Controllers/Auth/PasswordController.php
- +13 −0 app/Http/Controllers/Controller.php
- +52 −0 app/Http/Kernel.php
- +30 −0 app/Http/Middleware/Authenticate.php
- +17 −0 app/Http/Middleware/EncryptCookies.php
- +26 −0 app/Http/Middleware/RedirectIfAuthenticated.php
- +17 −0 app/Http/Middleware/VerifyCsrfToken.php
- +10 −0 app/Http/Requests/Request.php
- +31 −0 app/Http/routes.php
- +21 −0 app/Jobs/Job.php
- 0 app/Listeners/.gitkeep
- 0 app/Policies/.gitkeep
- +28 −0 app/Providers/AppServiceProvider.php
- +31 −0 app/Providers/AuthServiceProvider.php
- +33 −0 app/Providers/EventServiceProvider.php
- +44 −0 app/Providers/RouteServiceProvider.php
- +26 −0 app/User.php
- +51 −0 artisan
- +55 −0 bootstrap/app.php
- +34 −0 bootstrap/autoload.php
- +2 −0 bootstrap/cache/.gitignore
- +52 −0 composer.json
- +3,013 −0 composer.lock
- +207 −0 config/app.php
- +107 −0 config/auth.php
- +52 −0 config/broadcasting.php
- +81 −0 config/cache.php
- +35 −0 config/compile.php
- +128 −0 config/database.php
- +85 −0 config/filesystems.php
- +111 −0 config/mail.php
- +86 −0 config/queue.php
- +38 −0 config/services.php
- +153 −0 config/session.php
- +33 −0 config/view.php
- +1 −0 database/.gitignore
- +21 −0 database/factories/ModelFactory.php
- 0 database/migrations/.gitkeep
- +34 −0 database/migrations/2014_10_12_000000_create_users_table.php
- +31 −0 database/migrations/2014_10_12_100000_create_password_resets_table.php
- 0 database/seeds/.gitkeep
- +16 −0 database/seeds/DatabaseSeeder.php
- +16 −0 gulpfile.js
- +10 −0 package.json
- +27 −0 phpunit.xml
- +20 −0 public/.htaccess
- 0 public/favicon.ico
- +58 −0 public/index.php
- +2 −0 public/robots.txt
- +23 −0 public/web.config
- +27 −0 readme.md
- +2 −0 resources/assets/sass/app.scss
- +19 −0 resources/lang/en/auth.php
- +19 −0 resources/lang/en/pagination.php
- +22 −0 resources/lang/en/passwords.php
- +110 −0 resources/lang/en/validation.php
- +47 −0 resources/views/errors/503.blade.php
- 0 resources/views/vendor/.gitkeep
- +45 −0 resources/views/welcome.blade.php
- +21 −0 server.php
- +2 −0 storage/app/.gitignore
- +7 −0 storage/framework/.gitignore
- +2 −0 storage/framework/cache/.gitignore
- +2 −0 storage/framework/sessions/.gitignore
- +2 −0 storage/framework/views/.gitignore
- +2 −0 storage/logs/.gitignore
- +19 −0 tests/ExampleTest.php
- +25 −0 tests/TestCase.php
23
.env.example
| @@ -0,0 +1,23 @@ | ||
| +APP_ENV=local | ||
| +APP_DEBUG=true | ||
| +APP_KEY=SomeRandomString | ||
| + | ||
| +DB_HOST=127.0.0.1 | ||
| +DB_DATABASE=homestead | ||
| +DB_USERNAME=homestead | ||
| +DB_PASSWORD=secret | ||
| + | ||
| +CACHE_DRIVER=file | ||
| +SESSION_DRIVER=file | ||
| +QUEUE_DRIVER=sync | ||
| + | ||
| +REDIS_HOST=127.0.0.1 | ||
| +REDIS_PASSWORD=null | ||
| +REDIS_PORT=6379 | ||
| + | ||
| +MAIL_DRIVER=smtp | ||
| +MAIL_HOST=mailtrap.io | ||
| +MAIL_PORT=2525 | ||
| +MAIL_USERNAME=null | ||
| +MAIL_PASSWORD=null | ||
| +MAIL_ENCRYPTION=null |
| @@ -0,0 +1,3 @@ | ||
| +* text=auto | ||
| +*.css linguist-vendored | ||
| +*.less linguist-vendored |
| @@ -0,0 +1,5 @@ | ||
| +/vendor | ||
| +/node_modules | ||
| +Homestead.yaml | ||
| +Homestead.json | ||
| +.env |
| @@ -0,0 +1,33 @@ | ||
| +<?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); | ||
| + } | ||
| +} |
| @@ -0,0 +1,30 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Console; | ||
| + | ||
| +use Illuminate\Console\Scheduling\Schedule; | ||
| +use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
| + | ||
| +class Kernel extends ConsoleKernel | ||
| +{ | ||
| + /** | ||
| + * The Artisan commands provided by your application. | ||
| + * | ||
| + * @var array | ||
| + */ | ||
| + protected $commands = [ | ||
| + // Commands\Inspire::class, | ||
| + ]; | ||
| + | ||
| + /** | ||
| + * Define the application's command schedule. | ||
| + * | ||
| + * @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
| + * @return void | ||
| + */ | ||
| + protected function schedule(Schedule $schedule) | ||
| + { | ||
| + // $schedule->command('inspire') | ||
| + // ->hourly(); | ||
| + } | ||
| +} |
| @@ -0,0 +1,8 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Events; | ||
| + | ||
| +abstract class Event | ||
| +{ | ||
| + // | ||
| +} |
| @@ -0,0 +1,50 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Exceptions; | ||
| + | ||
| +use Exception; | ||
| +use Illuminate\Validation\ValidationException; | ||
| +use Illuminate\Auth\Access\AuthorizationException; | ||
| +use Illuminate\Database\Eloquent\ModelNotFoundException; | ||
| +use Symfony\Component\HttpKernel\Exception\HttpException; | ||
| +use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
| + | ||
| +class Handler extends ExceptionHandler | ||
| +{ | ||
| + /** | ||
| + * A list of the exception types that should not be reported. | ||
| + * | ||
| + * @var array | ||
| + */ | ||
| + protected $dontReport = [ | ||
| + AuthorizationException::class, | ||
| + HttpException::class, | ||
| + ModelNotFoundException::class, | ||
| + ValidationException::class, | ||
| + ]; | ||
| + | ||
| + /** | ||
| + * Report or log an exception. | ||
| + * | ||
| + * This is a great spot to send exceptions to Sentry, Bugsnag, etc. | ||
| + * | ||
| + * @param \Exception $e | ||
| + * @return void | ||
| + */ | ||
| + public function report(Exception $e) | ||
| + { | ||
| + parent::report($e); | ||
| + } | ||
| + | ||
| + /** | ||
| + * Render an exception into an HTTP response. | ||
| + * | ||
| + * @param \Illuminate\Http\Request $request | ||
| + * @param \Exception $e | ||
| + * @return \Illuminate\Http\Response | ||
| + */ | ||
| + public function render($request, Exception $e) | ||
| + { | ||
| + return parent::render($request, $e); | ||
| + } | ||
| +} |
| @@ -0,0 +1,72 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Http\Controllers\Auth; | ||
| + | ||
| +use App\User; | ||
| +use Validator; | ||
| +use App\Http\Controllers\Controller; | ||
| +use Illuminate\Foundation\Auth\ThrottlesLogins; | ||
| +use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; | ||
| + | ||
| +class AuthController extends Controller | ||
| +{ | ||
| + /* | ||
| + |-------------------------------------------------------------------------- | ||
| + | Registration & Login 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? | ||
| + | | ||
| + */ | ||
| + | ||
| + use AuthenticatesAndRegistersUsers, ThrottlesLogins; | ||
| + | ||
| + /** | ||
| + * Where to redirect users after login / registration. | ||
| + * | ||
| + * @var string | ||
| + */ | ||
| + protected $redirectTo = '/'; | ||
| + | ||
| + /** | ||
| + * Create a new authentication controller instance. | ||
| + * | ||
| + * @return void | ||
| + */ | ||
| + public function __construct() | ||
| + { | ||
| + $this->middleware('guest', ['except' => 'logout']); | ||
| + } | ||
| + | ||
| + /** | ||
| + * Get a validator for an incoming registration request. | ||
| + * | ||
| + * @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', | ||
| + 'password' => 'required|confirmed|min:6', | ||
| + ]); | ||
| + } | ||
| + | ||
| + /** | ||
| + * Create a new user instance after a valid registration. | ||
| + * | ||
| + * @param array $data | ||
| + * @return User | ||
| + */ | ||
| + protected function create(array $data) | ||
| + { | ||
| + return User::create([ | ||
| + 'name' => $data['name'], | ||
| + 'email' => $data['email'], | ||
| + 'password' => bcrypt($data['password']), | ||
| + ]); | ||
| + } | ||
| +} |
| @@ -0,0 +1,32 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Http\Controllers\Auth; | ||
| + | ||
| +use App\Http\Controllers\Controller; | ||
| +use Illuminate\Foundation\Auth\ResetsPasswords; | ||
| + | ||
| +class PasswordController extends Controller | ||
| +{ | ||
| + /* | ||
| + |-------------------------------------------------------------------------- | ||
| + | Password Reset Controller | ||
| + |-------------------------------------------------------------------------- | ||
| + | | ||
| + | This controller is responsible for handling password reset requests | ||
| + | and uses a simple trait to include this behavior. You're free to | ||
| + | explore this trait and override any methods you wish to tweak. | ||
| + | | ||
| + */ | ||
| + | ||
| + use ResetsPasswords; | ||
| + | ||
| + /** | ||
| + * Create a new password controller instance. | ||
| + * | ||
| + * @return void | ||
| + */ | ||
| + public function __construct() | ||
| + { | ||
| + $this->middleware('guest'); | ||
| + } | ||
| +} |
| @@ -0,0 +1,13 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Http\Controllers; | ||
| + | ||
| +use Illuminate\Foundation\Bus\DispatchesJobs; | ||
| +use Illuminate\Routing\Controller as BaseController; | ||
| +use Illuminate\Foundation\Validation\ValidatesRequests; | ||
| +use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||
| + | ||
| +class Controller extends BaseController | ||
| +{ | ||
| + use AuthorizesRequests, DispatchesJobs, ValidatesRequests; | ||
| +} |
| @@ -0,0 +1,52 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Http; | ||
| + | ||
| +use Illuminate\Foundation\Http\Kernel as HttpKernel; | ||
| + | ||
| +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 = [ | ||
| + \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, | ||
| + ], | ||
| + | ||
| + 'api' => [ | ||
| + 'throttle:60,1', | ||
| + ], | ||
| + ]; | ||
| + | ||
| + /** | ||
| + * 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.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, | ||
| + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, | ||
| + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, | ||
| + ]; | ||
| +} |
| @@ -0,0 +1,30 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Http\Middleware; | ||
| + | ||
| +use Closure; | ||
| +use Illuminate\Support\Facades\Auth; | ||
| + | ||
| +class Authenticate | ||
| +{ | ||
| + /** | ||
| + * Handle an incoming request. | ||
| + * | ||
| + * @param \Illuminate\Http\Request $request | ||
| + * @param \Closure $next | ||
| + * @param string|null $guard | ||
| + * @return mixed | ||
| + */ | ||
| + public function handle($request, Closure $next, $guard = null) | ||
| + { | ||
| + if (Auth::guard($guard)->guest()) { | ||
| + if ($request->ajax() || $request->wantsJson()) { | ||
| + return response('Unauthorized.', 401); | ||
| + } else { | ||
| + return redirect()->guest('login'); | ||
| + } | ||
| + } | ||
| + | ||
| + return $next($request); | ||
| + } | ||
| +} |
| @@ -0,0 +1,17 @@ | ||
| +<?php | ||
| + | ||
| +namespace App\Http\Middleware; | ||
| + | ||
| +use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter; | ||
| + | ||
| +class EncryptCookies extends BaseEncrypter | ||
| +{ | ||
| + /** | ||
| + * The names of the cookies that should not be encrypted. | ||
| + * | ||
| + * @var array | ||
| + */ | ||
| + protected $except = [ | ||
| + // | ||
| + ]; | ||
| +} |
Oops, something went wrong.
0 comments on commit
9d4040e