Permalink
Browse files

Initial Laravel import

  • Loading branch information...
1 parent b7fda0e commit cf81bf71028d8efa0729a3fec0124843e1fc605d @JarnoVgr committed Dec 4, 2015
Showing with 5,501 additions and 0 deletions.
  1. +19 −0 .env.example
  2. +3 −0 .gitattributes
  3. +4 −0 .gitignore
  4. +33 −0 app/Console/Commands/Inspire.php
  5. +30 −0 app/Console/Kernel.php
  6. +8 −0 app/Events/Event.php
  7. +51 −0 app/Exceptions/Handler.php
  8. +65 −0 app/Http/Controllers/Auth/AuthController.php
  9. +32 −0 app/Http/Controllers/Auth/PasswordController.php
  10. +13 −0 app/Http/Controllers/Controller.php
  11. +33 −0 app/Http/Kernel.php
  12. +47 −0 app/Http/Middleware/Authenticate.php
  13. +17 −0 app/Http/Middleware/EncryptCookies.php
  14. +43 −0 app/Http/Middleware/RedirectIfAuthenticated.php
  15. +17 −0 app/Http/Middleware/VerifyCsrfToken.php
  16. +10 −0 app/Http/Requests/Request.php
  17. +16 −0 app/Http/routes.php
  18. +21 −0 app/Jobs/Job.php
  19. 0 app/Listeners/.gitkeep
  20. 0 app/Policies/.gitkeep
  21. +28 −0 app/Providers/AppServiceProvider.php
  22. +31 −0 app/Providers/AuthServiceProvider.php
  23. +33 −0 app/Providers/EventServiceProvider.php
  24. +44 −0 app/Providers/RouteServiceProvider.php
  25. +39 −0 app/User.php
  26. +51 −0 artisan
  27. +55 −0 bootstrap/app.php
  28. +34 −0 bootstrap/autoload.php
  29. +2 −0 bootstrap/cache/.gitignore
  30. +51 −0 composer.json
  31. +2,999 −0 composer.lock
  32. +198 −0 config/app.php
  33. +67 −0 config/auth.php
  34. +52 −0 config/broadcasting.php
  35. +79 −0 config/cache.php
  36. +35 −0 config/compile.php
  37. +126 −0 config/database.php
  38. +85 −0 config/filesystems.php
  39. +124 −0 config/mail.php
  40. +94 −0 config/queue.php
  41. +38 −0 config/services.php
  42. +153 −0 config/session.php
  43. +33 −0 config/view.php
  44. +1 −0 database/.gitignore
  45. +21 −0 database/factories/ModelFactory.php
  46. 0 database/migrations/.gitkeep
  47. +34 −0 database/migrations/2014_10_12_000000_create_users_table.php
  48. +31 −0 database/migrations/2014_10_12_100000_create_password_resets_table.php
  49. 0 database/seeds/.gitkeep
  50. +21 −0 database/seeds/DatabaseSeeder.php
  51. +16 −0 gulpfile.js
  52. +10 −0 package.json
  53. +5 −0 phpspec.yml
  54. +27 −0 phpunit.xml
  55. +16 −0 public/.htaccess
  56. 0 public/favicon.ico
  57. +58 −0 public/index.php
  58. +2 −0 public/robots.txt
  59. +2 −0 resources/assets/sass/app.scss
  60. +19 −0 resources/lang/en/auth.php
  61. +19 −0 resources/lang/en/pagination.php
  62. +22 −0 resources/lang/en/passwords.php
  63. +110 −0 resources/lang/en/validation.php
  64. +47 −0 resources/views/errors/503.blade.php
  65. 0 resources/views/vendor/.gitkeep
  66. +45 −0 resources/views/welcome.blade.php
  67. +21 −0 server.php
  68. +2 −0 storage/app/.gitignore
  69. +7 −0 storage/framework/.gitignore
  70. +2 −0 storage/framework/cache/.gitignore
  71. +2 −0 storage/framework/sessions/.gitignore
  72. +2 −0 storage/framework/views/.gitignore
  73. +2 −0 storage/logs/.gitignore
  74. +19 −0 tests/ExampleTest.php
  75. +25 −0 tests/TestCase.php
View
@@ -0,0 +1,19 @@
+APP_ENV=local
+APP_DEBUG=true
+APP_KEY=SomeRandomString
+
+DB_HOST=localhost
+DB_DATABASE=homestead
+DB_USERNAME=homestead
+DB_PASSWORD=secret
+
+CACHE_DRIVER=file
+SESSION_DRIVER=file
+QUEUE_DRIVER=sync
+
+MAIL_DRIVER=smtp
+MAIL_HOST=mailtrap.io
+MAIL_PORT=2525
+MAIL_USERNAME=null
+MAIL_PASSWORD=null
+MAIL_ENCRYPTION=null
View
@@ -0,0 +1,3 @@
+* text=auto
+*.css linguist-vendored
+*.less linguist-vendored
View
@@ -1,4 +1,8 @@
/bootstrap/compiled.php
+/vendor
+/node_modules
.env.*.php
.env.php
.env
+Homestead.yaml
+Homestead.json
@@ -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,51 @@
+<?php
+
+namespace App\Exceptions;
+
+use Exception;
+use Illuminate\Database\Eloquent\ModelNotFoundException;
+use Symfony\Component\HttpKernel\Exception\HttpException;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+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 = [
+ HttpException::class,
+ ModelNotFoundException::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)
+ {
+ return 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)
+ {
+ if ($e instanceof ModelNotFoundException) {
+ $e = new NotFoundHttpException($e->getMessage(), $e);
+ }
+
+ return parent::render($request, $e);
+ }
+}
@@ -0,0 +1,65 @@
+<?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;
+
+ /**
+ * Create a new authentication controller instance.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $this->middleware('guest', ['except' => 'getLogout']);
+ }
+
+ /**
+ * 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;
+
+abstract class Controller extends BaseController
+{
+ use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+}
View
@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Http;
+
+use Illuminate\Foundation\Http\Kernel as HttpKernel;
+
+class Kernel extends HttpKernel
+{
+ /**
+ * The application's global HTTP middleware stack.
+ *
+ * @var array
+ */
+ protected $middleware = [
+ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
+ \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,
+ ];
+
+ /**
+ * The application's route middleware.
+ *
+ * @var array
+ */
+ protected $routeMiddleware = [
+ 'auth' => \App\Http\Middleware\Authenticate::class,
+ 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
+ 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
+ ];
+}
@@ -0,0 +1,47 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+use Illuminate\Contracts\Auth\Guard;
+
+class Authenticate
+{
+ /**
+ * The Guard implementation.
+ *
+ * @var Guard
+ */
+ protected $auth;
+
+ /**
+ * Create a new middleware instance.
+ *
+ * @param Guard $auth
+ * @return void
+ */
+ public function __construct(Guard $auth)
+ {
+ $this->auth = $auth;
+ }
+
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ if ($this->auth->guest()) {
+ if ($request->ajax()) {
+ return response('Unauthorized.', 401);
+ } else {
+ return redirect()->guest('auth/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 cf81bf7

Please sign in to comment.