Browse Source

:tada: Hello world!

Clement Desmidt 5 months ago
commit
50ecd5803a
100 changed files with 8454 additions and 0 deletions
  1. 15
    0
      .editorconfig
  2. 39
    0
      .env.example
  3. 5
    0
      .gitattributes
  4. 14
    0
      .gitignore
  5. 42
    0
      app/Console/Kernel.php
  6. 51
    0
      app/Exceptions/Handler.php
  7. 32
    0
      app/Http/Controllers/Auth/ForgotPasswordController.php
  8. 39
    0
      app/Http/Controllers/Auth/LoginController.php
  9. 72
    0
      app/Http/Controllers/Auth/RegisterController.php
  10. 39
    0
      app/Http/Controllers/Auth/ResetPasswordController.php
  11. 41
    0
      app/Http/Controllers/Auth/VerificationController.php
  12. 13
    0
      app/Http/Controllers/Controller.php
  13. 50
    0
      app/Http/Controllers/HomeController.php
  14. 36
    0
      app/Http/Controllers/LinksController.php
  15. 32
    0
      app/Http/Controllers/UsersController.php
  16. 80
    0
      app/Http/Kernel.php
  17. 33
    0
      app/Http/Middleware/Authenticate.php
  18. 17
    0
      app/Http/Middleware/CheckForMaintenanceMode.php
  19. 17
    0
      app/Http/Middleware/EncryptCookies.php
  20. 26
    0
      app/Http/Middleware/RedirectIfAuthenticated.php
  21. 18
    0
      app/Http/Middleware/TrimStrings.php
  22. 23
    0
      app/Http/Middleware/TrustProxies.php
  23. 24
    0
      app/Http/Middleware/VerifyCsrfToken.php
  24. 33
    0
      app/Link.php
  25. 40
    0
      app/Mail/Link.php
  26. 28
    0
      app/Providers/AppServiceProvider.php
  27. 37
    0
      app/Providers/AuthServiceProvider.php
  28. 21
    0
      app/Providers/BroadcastServiceProvider.php
  29. 34
    0
      app/Providers/EventServiceProvider.php
  30. 73
    0
      app/Providers/RouteServiceProvider.php
  31. 112
    0
      app/Services/Auth/TokenGuard.php
  32. 94
    0
      app/User.php
  33. 53
    0
      artisan
  34. 55
    0
      bootstrap/app.php
  35. 2
    0
      bootstrap/cache/.gitignore
  36. 61
    0
      composer.json
  37. 4361
    0
      composer.lock
  38. 227
    0
      config/app.php
  39. 102
    0
      config/auth.php
  40. 59
    0
      config/broadcasting.php
  41. 93
    0
      config/cache.php
  42. 130
    0
      config/database.php
  43. 69
    0
      config/filesystems.php
  44. 52
    0
      config/hashing.php
  45. 92
    0
      config/logging.php
  46. 123
    0
      config/mail.php
  47. 86
    0
      config/queue.php
  48. 39
    0
      config/services.php
  49. 199
    0
      config/session.php
  50. 33
    0
      config/view.php
  51. 1
    0
      database/.gitignore
  52. 19
    0
      database/factories/ModelFactory.php
  53. 10
    0
      database/factories/UserFactory.php
  54. 0
    0
      database/migrations/.gitkeep
  55. 33
    0
      database/migrations/2018_04_09_175146_create_users_table.php
  56. 32
    0
      database/migrations/2018_04_09_183912_create_bans_table.php
  57. 32
    0
      database/migrations/2018_10_12_210601_rename_token_field.php
  58. 16
    0
      database/seeds/DatabaseSeeder.php
  59. 16
    0
      database/seeds/UsersTableSeeder.php
  60. 22
    0
      package.json
  61. 33
    0
      phpunit.xml
  62. 21
    0
      public/.htaccess
  63. 6
    0
      public/css/app.css
  64. 0
    0
      public/favicon.ico
  65. BIN
      public/images/logo.png
  66. 60
    0
      public/index.php
  67. 1
    0
      public/js/app.js
  68. 2
    0
      public/robots.txt
  69. 1
    0
      public/svg/403.svg
  70. 1
    0
      public/svg/404.svg
  71. 1
    0
      public/svg/500.svg
  72. 1
    0
      public/svg/503.svg
  73. 22
    0
      resources/js/app.js
  74. 56
    0
      resources/js/bootstrap.js
  75. 23
    0
      resources/js/components/ExampleComponent.vue
  76. 19
    0
      resources/lang/en/auth.php
  77. 19
    0
      resources/lang/en/pagination.php
  78. 22
    0
      resources/lang/en/passwords.php
  79. 146
    0
      resources/lang/en/validation.php
  80. 20
    0
      resources/sass/_variables.scss
  81. 14
    0
      resources/sass/app.scss
  82. 0
    0
      resources/views/emails.php
  83. 395
    0
      resources/views/emails/link.blade.php
  84. 5
    0
      resources/views/home.blade.php
  85. 101
    0
      resources/views/layouts/app.blade.php
  86. 10
    0
      resources/views/registered.blade.php
  87. 6
    0
      resources/views/registration.blade.php
  88. 98
    0
      resources/views/welcome.blade.php
  89. 30
    0
      routes/api.php
  90. 16
    0
      routes/channels.php
  91. 18
    0
      routes/console.php
  92. 19
    0
      routes/web.php
  93. 21
    0
      server.php
  94. 3
    0
      storage/app/.gitignore
  95. 2
    0
      storage/app/public/.gitignore
  96. 8
    0
      storage/framework/.gitignore
  97. 3
    0
      storage/framework/cache/.gitignore
  98. 2
    0
      storage/framework/cache/data/.gitignore
  99. 2
    0
      storage/framework/sessions/.gitignore
  100. 0
    0
      storage/framework/testing/.gitignore

+ 15
- 0
.editorconfig View File

@@ -0,0 +1,15 @@
1
+root = true
2
+
3
+[*]
4
+charset = utf-8
5
+end_of_line = lf
6
+insert_final_newline = true
7
+indent_style = space
8
+indent_size = 4
9
+trim_trailing_whitespace = true
10
+
11
+[*.md]
12
+trim_trailing_whitespace = false
13
+
14
+[*.yml]
15
+indent_size = 2

+ 39
- 0
.env.example View File

@@ -0,0 +1,39 @@
1
+APP_NAME=Laravel
2
+APP_ENV=local
3
+APP_KEY=
4
+APP_DEBUG=true
5
+APP_URL=http://localhost
6
+
7
+LOG_CHANNEL=stack
8
+
9
+DB_CONNECTION=mysql
10
+DB_HOST=127.0.0.1
11
+DB_PORT=3306
12
+DB_DATABASE=homestead
13
+DB_USERNAME=homestead
14
+DB_PASSWORD=secret
15
+
16
+BROADCAST_DRIVER=log
17
+CACHE_DRIVER=file
18
+QUEUE_CONNECTION=sync
19
+SESSION_DRIVER=file
20
+SESSION_LIFETIME=120
21
+
22
+REDIS_HOST=127.0.0.1
23
+REDIS_PASSWORD=null
24
+REDIS_PORT=6379
25
+
26
+MAIL_DRIVER=smtp
27
+MAIL_HOST=smtp.mailtrap.io
28
+MAIL_PORT=2525
29
+MAIL_USERNAME=null
30
+MAIL_PASSWORD=null
31
+MAIL_ENCRYPTION=null
32
+
33
+PUSHER_APP_ID=
34
+PUSHER_APP_KEY=
35
+PUSHER_APP_SECRET=
36
+PUSHER_APP_CLUSTER=mt1
37
+
38
+MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39
+MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

+ 5
- 0
.gitattributes View File

@@ -0,0 +1,5 @@
1
+* text=auto
2
+*.css linguist-vendored
3
+*.scss linguist-vendored
4
+*.js linguist-vendored
5
+CHANGELOG.md export-ignore

+ 14
- 0
.gitignore View File

@@ -0,0 +1,14 @@
1
+/node_modules
2
+/public/hot
3
+/public/storage
4
+/storage/*.key
5
+/vendor
6
+/.idea
7
+/.vscode
8
+/.vagrant
9
+Homestead.json
10
+Homestead.yaml
11
+npm-debug.log
12
+yarn-error.log
13
+.env
14
+.phpunit.result.cache

+ 42
- 0
app/Console/Kernel.php View File

@@ -0,0 +1,42 @@
1
+<?php
2
+
3
+namespace App\Console;
4
+
5
+use Illuminate\Console\Scheduling\Schedule;
6
+use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7
+
8
+class Kernel extends ConsoleKernel
9
+{
10
+    /**
11
+     * The Artisan commands provided by your application.
12
+     *
13
+     * @var array
14
+     */
15
+    protected $commands = [
16
+        //
17
+    ];
18
+
19
+    /**
20
+     * Define the application's command schedule.
21
+     *
22
+     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
23
+     * @return void
24
+     */
25
+    protected function schedule(Schedule $schedule)
26
+    {
27
+        // $schedule->command('inspire')
28
+        //          ->hourly();
29
+    }
30
+
31
+    /**
32
+     * Register the commands for the application.
33
+     *
34
+     * @return void
35
+     */
36
+    protected function commands()
37
+    {
38
+        $this->load(__DIR__.'/Commands');
39
+
40
+        require base_path('routes/console.php');
41
+    }
42
+}

+ 51
- 0
app/Exceptions/Handler.php View File

@@ -0,0 +1,51 @@
1
+<?php
2
+
3
+namespace App\Exceptions;
4
+
5
+use Exception;
6
+use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7
+
8
+class Handler extends ExceptionHandler
9
+{
10
+    /**
11
+     * A list of the exception types that are not reported.
12
+     *
13
+     * @var array
14
+     */
15
+    protected $dontReport = [
16
+        //
17
+    ];
18
+
19
+    /**
20
+     * A list of the inputs that are never flashed for validation exceptions.
21
+     *
22
+     * @var array
23
+     */
24
+    protected $dontFlash = [
25
+        'password',
26
+        'password_confirmation',
27
+    ];
28
+
29
+    /**
30
+     * Report or log an exception.
31
+     *
32
+     * @param  \Exception  $exception
33
+     * @return void
34
+     */
35
+    public function report(Exception $exception)
36
+    {
37
+        parent::report($exception);
38
+    }
39
+
40
+    /**
41
+     * Render an exception into an HTTP response.
42
+     *
43
+     * @param  \Illuminate\Http\Request  $request
44
+     * @param  \Exception  $exception
45
+     * @return \Illuminate\Http\Response
46
+     */
47
+    public function render($request, Exception $exception)
48
+    {
49
+        return parent::render($request, $exception);
50
+    }
51
+}

+ 32
- 0
app/Http/Controllers/Auth/ForgotPasswordController.php View File

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7
+
8
+class ForgotPasswordController extends Controller
9
+{
10
+    /*
11
+    |--------------------------------------------------------------------------
12
+    | Password Reset Controller
13
+    |--------------------------------------------------------------------------
14
+    |
15
+    | This controller is responsible for handling password reset emails and
16
+    | includes a trait which assists in sending these notifications from
17
+    | your application to your users. Feel free to explore this trait.
18
+    |
19
+    */
20
+
21
+    use SendsPasswordResetEmails;
22
+
23
+    /**
24
+     * Create a new controller instance.
25
+     *
26
+     * @return void
27
+     */
28
+    public function __construct()
29
+    {
30
+        $this->middleware('guest');
31
+    }
32
+}

+ 39
- 0
app/Http/Controllers/Auth/LoginController.php View File

@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use Illuminate\Foundation\Auth\AuthenticatesUsers;
7
+
8
+class LoginController extends Controller
9
+{
10
+    /*
11
+    |--------------------------------------------------------------------------
12
+    | Login Controller
13
+    |--------------------------------------------------------------------------
14
+    |
15
+    | This controller handles authenticating users for the application and
16
+    | redirecting them to your home screen. The controller uses a trait
17
+    | to conveniently provide its functionality to your applications.
18
+    |
19
+    */
20
+
21
+    use AuthenticatesUsers;
22
+
23
+    /**
24
+     * Where to redirect users after login.
25
+     *
26
+     * @var string
27
+     */
28
+    protected $redirectTo = '/home';
29
+
30
+    /**
31
+     * Create a new controller instance.
32
+     *
33
+     * @return void
34
+     */
35
+    public function __construct()
36
+    {
37
+        $this->middleware('guest')->except('logout');
38
+    }
39
+}

+ 72
- 0
app/Http/Controllers/Auth/RegisterController.php View File

@@ -0,0 +1,72 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\User;
6
+use App\Http\Controllers\Controller;
7
+use Illuminate\Support\Facades\Hash;
8
+use Illuminate\Support\Facades\Validator;
9
+use Illuminate\Foundation\Auth\RegistersUsers;
10
+
11
+class RegisterController extends Controller
12
+{
13
+    /*
14
+    |--------------------------------------------------------------------------
15
+    | Register Controller
16
+    |--------------------------------------------------------------------------
17
+    |
18
+    | This controller handles the registration of new users as well as their
19
+    | validation and creation. By default this controller uses a trait to
20
+    | provide this functionality without requiring any additional code.
21
+    |
22
+    */
23
+
24
+    use RegistersUsers;
25
+
26
+    /**
27
+     * Where to redirect users after registration.
28
+     *
29
+     * @var string
30
+     */
31
+    protected $redirectTo = '/home';
32
+
33
+    /**
34
+     * Create a new controller instance.
35
+     *
36
+     * @return void
37
+     */
38
+    public function __construct()
39
+    {
40
+        $this->middleware('guest');
41
+    }
42
+
43
+    /**
44
+     * Get a validator for an incoming registration request.
45
+     *
46
+     * @param  array  $data
47
+     * @return \Illuminate\Contracts\Validation\Validator
48
+     */
49
+    protected function validator(array $data)
50
+    {
51
+        return Validator::make($data, [
52
+            'name' => 'required|string|max:255',
53
+            'email' => 'required|string|email|max:255|unique:users',
54
+            'password' => 'required|string|min:6|confirmed',
55
+        ]);
56
+    }
57
+
58
+    /**
59
+     * Create a new user instance after a valid registration.
60
+     *
61
+     * @param  array  $data
62
+     * @return \App\User
63
+     */
64
+    protected function create(array $data)
65
+    {
66
+        return User::create([
67
+            'name' => $data['name'],
68
+            'email' => $data['email'],
69
+            'password' => Hash::make($data['password']),
70
+        ]);
71
+    }
72
+}

+ 39
- 0
app/Http/Controllers/Auth/ResetPasswordController.php View File

@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use Illuminate\Foundation\Auth\ResetsPasswords;
7
+
8
+class ResetPasswordController extends Controller
9
+{
10
+    /*
11
+    |--------------------------------------------------------------------------
12
+    | Password Reset Controller
13
+    |--------------------------------------------------------------------------
14
+    |
15
+    | This controller is responsible for handling password reset requests
16
+    | and uses a simple trait to include this behavior. You're free to
17
+    | explore this trait and override any methods you wish to tweak.
18
+    |
19
+    */
20
+
21
+    use ResetsPasswords;
22
+
23
+    /**
24
+     * Where to redirect users after resetting their password.
25
+     *
26
+     * @var string
27
+     */
28
+    protected $redirectTo = '/home';
29
+
30
+    /**
31
+     * Create a new controller instance.
32
+     *
33
+     * @return void
34
+     */
35
+    public function __construct()
36
+    {
37
+        $this->middleware('guest');
38
+    }
39
+}

+ 41
- 0
app/Http/Controllers/Auth/VerificationController.php View File

@@ -0,0 +1,41 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use Illuminate\Foundation\Auth\VerifiesEmails;
7
+
8
+class VerificationController extends Controller
9
+{
10
+    /*
11
+    |--------------------------------------------------------------------------
12
+    | Email Verification Controller
13
+    |--------------------------------------------------------------------------
14
+    |
15
+    | This controller is responsible for handling email verification for any
16
+    | user that recently registered with the application. Emails may also
17
+    | be re-sent if the user didn't receive the original email message.
18
+    |
19
+    */
20
+
21
+    use VerifiesEmails;
22
+
23
+    /**
24
+     * Where to redirect users after verification.
25
+     *
26
+     * @var string
27
+     */
28
+    protected $redirectTo = '/home';
29
+
30
+    /**
31
+     * Create a new controller instance.
32
+     *
33
+     * @return void
34
+     */
35
+    public function __construct()
36
+    {
37
+        $this->middleware('auth');
38
+        $this->middleware('signed')->only('verify');
39
+        $this->middleware('throttle:6,1')->only('verify', 'resend');
40
+    }
41
+}

+ 13
- 0
app/Http/Controllers/Controller.php View File

@@ -0,0 +1,13 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Foundation\Bus\DispatchesJobs;
6
+use Illuminate\Routing\Controller as BaseController;
7
+use Illuminate\Foundation\Validation\ValidatesRequests;
8
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
9
+
10
+class Controller extends BaseController
11
+{
12
+    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
13
+}

+ 50
- 0
app/Http/Controllers/HomeController.php View File

@@ -0,0 +1,50 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+
6
+use App\User;
7
+use Illuminate\Http\Request;
8
+use Illuminate\Validation\ValidationException;
9
+
10
+class HomeController extends Controller
11
+{
12
+    public function home(Request $request)
13
+    {
14
+        return view('home');
15
+    }
16
+
17
+    public function iframe(Request $request)
18
+    {
19
+        $user = null;
20
+
21
+        try {
22
+            $errors = [];
23
+            $data = $this->validate($request, [
24
+                'email' => 'required|email|unique:users'
25
+            ]);
26
+
27
+            $token = bin2hex(random_bytes(72));
28
+
29
+            $user = new User(['email' => $data['email']]);
30
+            $user->token = $token;
31
+            $user->save();
32
+
33
+            return view('registered', [
34
+                'user' => $user,
35
+            ]);
36
+
37
+        } catch (ValidationException $e) {
38
+            $errors = $e->errors();
39
+            $data = [];
40
+        } catch (\Exception $e) {
41
+            $errors = ['email' => 'Impossible de générer le token'];
42
+            $data = [];
43
+        }
44
+
45
+        return view('registration', [
46
+            'data' => $data,
47
+            'errors' => $errors
48
+        ]);
49
+    }
50
+}

+ 36
- 0
app/Http/Controllers/LinksController.php View File

@@ -0,0 +1,36 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use App\Link;
6
+use App\Mail\Link as MailLink;
7
+use App\User;
8
+use Illuminate\Http\Request;
9
+use Illuminate\Support\Facades\Mail;
10
+
11
+class LinksController extends Controller
12
+{
13
+    public function add(Request $request)
14
+    {
15
+        /** @var User $user */
16
+        $user   = $request->user();
17
+        $email  = $user->email;
18
+
19
+        $url = $request->input('u');
20
+        $url = filter_var($url, FILTER_VALIDATE_URL);
21
+        if ($url === false) {
22
+            return response()->json(['error' => 'Invalid link.'], 422);
23
+        }
24
+
25
+        $title          = $request->input('t') ?: '';
26
+        $description    = $request->input('d') ?: '';
27
+
28
+        $link = new Link($title, $url);
29
+        if (!empty($description)) {
30
+            $link->description = $description;
31
+        }
32
+        Mail::to($email)->send(new MailLink($link));
33
+
34
+        return response()->json(['info' => 'Email sent.']);
35
+    }
36
+}

+ 32
- 0
app/Http/Controllers/UsersController.php View File

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use App\User;
6
+use Illuminate\Http\Request;
7
+use Illuminate\Validation\ValidationException;
8
+
9
+class UsersController extends Controller
10
+{
11
+    public function create(Request $request)
12
+    {
13
+        try {
14
+            $data = $this->validate($request, [
15
+                'email' => 'required|email|unique:users'
16
+            ]);
17
+
18
+            $token = User::generateToken();
19
+
20
+            $user = new User(['email' => $data['email']]);
21
+            $user->token = $token;
22
+            $user->save();
23
+
24
+            return response()->json(['token' => $token, 'email' => $data['email']]);
25
+
26
+        } catch (ValidationException $e) {
27
+            return response()->json(['error' => $e->errors()], 422);
28
+        } catch (\Exception $e) {
29
+            return response()->json(['error' => $e->getMessage()], 422);
30
+        }
31
+    }
32
+}

+ 80
- 0
app/Http/Kernel.php View File

@@ -0,0 +1,80 @@
1
+<?php
2
+
3
+namespace App\Http;
4
+
5
+use Illuminate\Foundation\Http\Kernel as HttpKernel;
6
+
7
+class Kernel extends HttpKernel
8
+{
9
+    /**
10
+     * The application's global HTTP middleware stack.
11
+     *
12
+     * These middleware are run during every request to your application.
13
+     *
14
+     * @var array
15
+     */
16
+    protected $middleware = [
17
+        \App\Http\Middleware\CheckForMaintenanceMode::class,
18
+        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
19
+        \App\Http\Middleware\TrimStrings::class,
20
+        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
21
+        \App\Http\Middleware\TrustProxies::class,
22
+    ];
23
+
24
+    /**
25
+     * The application's route middleware groups.
26
+     *
27
+     * @var array
28
+     */
29
+    protected $middlewareGroups = [
30
+        'web' => [
31
+            \App\Http\Middleware\EncryptCookies::class,
32
+            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
33
+            \Illuminate\Session\Middleware\StartSession::class,
34
+            // \Illuminate\Session\Middleware\AuthenticateSession::class,
35
+            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
36
+//            \App\Http\Middleware\VerifyCsrfToken::class,
37
+            \Illuminate\Routing\Middleware\SubstituteBindings::class,
38
+        ],
39
+
40
+        'api' => [
41
+            'throttle:60,1',
42
+            'bindings',
43
+        ],
44
+    ];
45
+
46
+    /**
47
+     * The application's route middleware.
48
+     *
49
+     * These middleware may be assigned to groups or used individually.
50
+     *
51
+     * @var array
52
+     */
53
+    protected $routeMiddleware = [
54
+        'auth' => \App\Http\Middleware\Authenticate::class,
55
+        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
56
+        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
57
+        'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
58
+        'can' => \Illuminate\Auth\Middleware\Authorize::class,
59
+        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
60
+        'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
61
+        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
62
+        'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
63
+    ];
64
+
65
+    /**
66
+     * The priority-sorted list of middleware.
67
+     *
68
+     * This forces the listed middleware to always be in the given order.
69
+     *
70
+     * @var array
71
+     */
72
+    protected $middlewarePriority = [
73
+        \Illuminate\Session\Middleware\StartSession::class,
74
+        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
75
+        \App\Http\Middleware\Authenticate::class,
76
+        \Illuminate\Session\Middleware\AuthenticateSession::class,
77
+        \Illuminate\Routing\Middleware\SubstituteBindings::class,
78
+        \Illuminate\Auth\Middleware\Authorize::class,
79
+    ];
80
+}

+ 33
- 0
app/Http/Middleware/Authenticate.php View File

@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Closure;
6
+use Illuminate\Support\Facades\Auth;
7
+
8
+class Authenticate extends \Illuminate\Auth\Middleware\Authenticate
9
+{
10
+    /**
11
+     * The authentication guard factory instance.
12
+     *
13
+     * @var \Illuminate\Contracts\Auth\Factory
14
+     */
15
+    protected $auth;
16
+
17
+    /**
18
+     * Handle an incoming request.
19
+     *
20
+     * @param  \Illuminate\Http\Request $request
21
+     * @param  \Closure $next
22
+     * @param mixed ...$guard
23
+     * @return mixed
24
+     */
25
+    public function handle($request, Closure $next, ...$guard)
26
+    {
27
+        if ($this->auth->guard($guard)->guest()) {
28
+            return response('Unauthorized.', 401);
29
+        }
30
+
31
+        return $next($request);
32
+    }
33
+}

+ 17
- 0
app/Http/Middleware/CheckForMaintenanceMode.php View File

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
6
+
7
+class CheckForMaintenanceMode extends Middleware
8
+{
9
+    /**
10
+     * The URIs that should be reachable while maintenance mode is enabled.
11
+     *
12
+     * @var array
13
+     */
14
+    protected $except = [
15
+        //
16
+    ];
17
+}

+ 17
- 0
app/Http/Middleware/EncryptCookies.php View File

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
6
+
7
+class EncryptCookies extends Middleware
8
+{
9
+    /**
10
+     * The names of the cookies that should not be encrypted.
11
+     *
12
+     * @var array
13
+     */
14
+    protected $except = [
15
+        //
16
+    ];
17
+}

+ 26
- 0
app/Http/Middleware/RedirectIfAuthenticated.php View File

@@ -0,0 +1,26 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Closure;
6
+use Illuminate\Support\Facades\Auth;
7
+
8
+class RedirectIfAuthenticated
9
+{
10
+    /**
11
+     * Handle an incoming request.
12
+     *
13
+     * @param  \Illuminate\Http\Request  $request
14
+     * @param  \Closure  $next
15
+     * @param  string|null  $guard
16
+     * @return mixed
17
+     */
18
+    public function handle($request, Closure $next, $guard = null)
19
+    {
20
+        if (Auth::guard($guard)->check()) {
21
+            return redirect('/home');
22
+        }
23
+
24
+        return $next($request);
25
+    }
26
+}

+ 18
- 0
app/Http/Middleware/TrimStrings.php View File

@@ -0,0 +1,18 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
6
+
7
+class TrimStrings extends Middleware
8
+{
9
+    /**
10
+     * The names of the attributes that should not be trimmed.
11
+     *
12
+     * @var array
13
+     */
14
+    protected $except = [
15
+        'password',
16
+        'password_confirmation',
17
+    ];
18
+}

+ 23
- 0
app/Http/Middleware/TrustProxies.php View File

@@ -0,0 +1,23 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Http\Request;
6
+use Fideloper\Proxy\TrustProxies as Middleware;
7
+
8
+class TrustProxies extends Middleware
9
+{
10
+    /**
11
+     * The trusted proxies for this application.
12
+     *
13
+     * @var array
14
+     */
15
+    protected $proxies;
16
+
17
+    /**
18
+     * The headers that should be used to detect proxies.
19
+     *
20
+     * @var int
21
+     */
22
+    protected $headers = Request::HEADER_X_FORWARDED_ALL;
23
+}

+ 24
- 0
app/Http/Middleware/VerifyCsrfToken.php View File

@@ -0,0 +1,24 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
6
+
7
+class VerifyCsrfToken extends Middleware
8
+{
9
+    /**
10
+     * Indicates whether the XSRF-TOKEN cookie should be set on the response.
11
+     *
12
+     * @var bool
13
+     */
14
+    protected $addHttpCookie = true;
15
+
16
+    /**
17
+     * The URIs that should be excluded from CSRF verification.
18
+     *
19
+     * @var array
20
+     */
21
+    protected $except = [
22
+        'api/*'
23
+    ];
24
+}

+ 33
- 0
app/Link.php View File

@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+namespace App;
4
+
5
+
6
+class Link
7
+{
8
+    /**
9
+     * @var string
10
+     */
11
+    public $title;
12
+
13
+    /**
14
+     * @var string
15
+     */
16
+    public $description = '';
17
+
18
+    /**
19
+     * @var string
20
+     */
21
+    public $url;
22
+
23
+    /**
24
+     * Link constructor.
25
+     * @param string $title
26
+     * @param string $url
27
+     */
28
+    public function __construct(string $title, string $url)
29
+    {
30
+        $this->title = $title;
31
+        $this->url = $url;
32
+    }
33
+}

+ 40
- 0
app/Mail/Link.php View File

@@ -0,0 +1,40 @@
1
+<?php
2
+
3
+namespace App\Mail;
4
+
5
+use Illuminate\Bus\Queueable;
6
+use Illuminate\Mail\Mailable;
7
+use Illuminate\Queue\SerializesModels;
8
+use Illuminate\Contracts\Queue\ShouldQueue;
9
+
10
+class Link extends Mailable
11
+{
12
+    use Queueable, SerializesModels;
13
+
14
+    /**
15
+     * The link to send
16
+     *
17
+     * @var \App\Link
18
+     */
19
+    protected $link;
20
+
21
+    /**
22
+     * Create a new message instance.
23
+     *
24
+     * @return void
25
+     */
26
+    public function __construct(\App\Link $link)
27
+    {
28
+        $this->link = $link;
29
+    }
30
+
31
+    /**
32
+     * Build the message.
33
+     *
34
+     * @return $this
35
+     */
36
+    public function build()
37
+    {
38
+        return $this->view('emails.link')->with(['link' => $this->link]);
39
+    }
40
+}

+ 28
- 0
app/Providers/AppServiceProvider.php View File

@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Support\ServiceProvider;
6
+
7
+class AppServiceProvider extends ServiceProvider
8
+{
9
+    /**
10
+     * Bootstrap any application services.
11
+     *
12
+     * @return void
13
+     */
14
+    public function boot()
15
+    {
16
+        //
17
+    }
18
+
19
+    /**
20
+     * Register any application services.
21
+     *
22
+     * @return void
23
+     */
24
+    public function register()
25
+    {
26
+        //
27
+    }
28
+}

+ 37
- 0
app/Providers/AuthServiceProvider.php View File

@@ -0,0 +1,37 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use App\User;
6
+use App\Services\Auth\TokenGuard;
7
+use Illuminate\Http\Request;
8
+use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
9
+use Illuminate\Support\Facades\Auth;
10
+
11
+class AuthServiceProvider extends ServiceProvider
12
+{
13
+    /**
14
+     * The policy mappings for the application.
15
+     *
16
+     * @var array
17
+     */
18
+    protected $policies = [
19
+        'App\Model' => 'App\Policies\ModelPolicy',
20
+    ];
21
+
22
+    /**
23
+     * Register any authentication / authorization services.
24
+     *
25
+     * @return void
26
+     */
27
+    public function boot()
28
+    {
29
+        $this->registerPolicies();
30
+
31
+        $this->app['auth']->viaRequest('custom', function ( Request $request) {
32
+            if ($request->input('token')) {
33
+                return User::where('token', $request->input('token'))->first();
34
+            }
35
+        });
36
+    }
37
+}

+ 21
- 0
app/Providers/BroadcastServiceProvider.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Support\ServiceProvider;
6
+use Illuminate\Support\Facades\Broadcast;
7
+
8
+class BroadcastServiceProvider extends ServiceProvider
9
+{
10
+    /**
11
+     * Bootstrap any application services.
12
+     *
13
+     * @return void
14
+     */
15
+    public function boot()
16
+    {
17
+        Broadcast::routes();
18
+
19
+        require base_path('routes/channels.php');
20
+    }
21
+}

+ 34
- 0
app/Providers/EventServiceProvider.php View File

@@ -0,0 +1,34 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Support\Facades\Event;
6
+use Illuminate\Auth\Events\Registered;
7
+use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
8
+use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
9
+
10
+class EventServiceProvider extends ServiceProvider
11
+{
12
+    /**
13
+     * The event listener mappings for the application.
14
+     *
15
+     * @var array
16
+     */
17
+    protected $listen = [
18
+        Registered::class => [
19
+            SendEmailVerificationNotification::class,
20
+        ],
21
+    ];
22
+
23
+    /**
24
+     * Register any events for your application.
25
+     *
26
+     * @return void
27
+     */
28
+    public function boot()
29
+    {
30
+        parent::boot();
31
+
32
+        //
33
+    }
34
+}

+ 73
- 0
app/Providers/RouteServiceProvider.php View File

@@ -0,0 +1,73 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Support\Facades\Route;
6
+use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
7
+
8
+class RouteServiceProvider extends ServiceProvider
9
+{
10
+    /**
11
+     * This namespace is applied to your controller routes.
12
+     *
13
+     * In addition, it is set as the URL generator's root namespace.
14
+     *
15
+     * @var string
16
+     */
17
+    protected $namespace = 'App\Http\Controllers';
18
+
19
+    /**
20
+     * Define your route model bindings, pattern filters, etc.
21
+     *
22
+     * @return void
23
+     */
24
+    public function boot()
25
+    {
26
+        //
27
+
28
+        parent::boot();
29
+    }
30
+
31
+    /**
32
+     * Define the routes for the application.
33
+     *
34
+     * @return void
35
+     */
36
+    public function map()
37
+    {
38
+        $this->mapApiRoutes();
39
+
40
+        $this->mapWebRoutes();
41
+
42
+        //
43
+    }
44
+
45
+    /**
46
+     * Define the "web" routes for the application.
47
+     *
48
+     * These routes all receive session state, CSRF protection, etc.
49
+     *
50
+     * @return void
51
+     */
52
+    protected function mapWebRoutes()
53
+    {
54
+        Route::middleware('web')
55
+             ->namespace($this->namespace)
56
+             ->group(base_path('routes/web.php'));
57
+    }
58
+
59
+    /**
60
+     * Define the "api" routes for the application.
61
+     *
62
+     * These routes are typically stateless.
63
+     *
64
+     * @return void
65
+     */
66
+    protected function mapApiRoutes()
67
+    {
68
+        Route::prefix('api')
69
+             ->middleware('api')
70
+             ->namespace($this->namespace)
71
+             ->group(base_path('routes/api.php'));
72
+    }
73
+}

+ 112
- 0
app/Services/Auth/TokenGuard.php View File

@@ -0,0 +1,112 @@
1
+<?php
2
+
3
+namespace App\Services\Auth;
4
+
5
+use App\User;
6
+use Illuminate\Contracts\Auth\Authenticatable;
7
+use Illuminate\Contracts\Auth\Guard;
8
+use Illuminate\Contracts\Auth\UserProvider;
9
+use Illuminate\Http\Request;
10
+
11
+class TokenGuard implements Guard
12
+{
13
+    /** @var User */
14
+    protected $user;
15
+    /** @var Request */
16
+    protected $request;
17
+    /** @var UserProvider|\Illuminate\Contracts\Auth\UserProvider  */
18
+    protected $provider;
19
+
20
+    /**
21
+     * Create a new authentication guard.
22
+     *
23
+     * @param  \Illuminate\Contracts\Auth\UserProvider  $provider
24
+     * @param  \Illuminate\Http\Request  $request
25
+     * @return void
26
+     */
27
+    public function __construct(UserProvider $provider, Request $request)
28
+    {
29
+        $this->request = $request;
30
+        $this->provider = $provider;
31
+        $this->user = NULL;
32
+    }
33
+    /**
34
+     * Determine if the current user is authenticated.
35
+     *
36
+     * @return bool
37
+     */
38
+    public function check()
39
+    {
40
+        return null !== $this->user;
41
+    }
42
+
43
+    /**
44
+     * Determine if the current user is a guest.
45
+     *
46
+     * @return bool
47
+     */
48
+    public function guest()
49
+    {
50
+        return ! $this->check();
51
+    }
52
+
53
+    /**
54
+     * Get the currently authenticated user.
55
+     *
56
+     * @return \Illuminate\Contracts\Auth\Authenticatable|null
57
+     */
58
+    public function user()
59
+    {
60
+        if ($this->check()) {
61
+            return $this->user;
62
+        }
63
+    }
64
+
65
+    /**
66
+     * Get the ID for the currently authenticated user.
67
+     *
68
+     * @return int|null
69
+     */
70
+    public function id()
71
+    {
72
+        if ($this->check()) {
73
+            return $this->user->id;
74
+        }
75
+
76
+        return null;
77
+    }
78
+
79
+    /**
80
+     * Validate a user's credentials.
81
+     *
82
+     * @param  array $credentials
83
+     * @return bool
84
+     */
85
+    public function validate(array $credentials = [])
86
+    {
87
+        if (!array_key_exists('token', $credentials)) {
88
+            return false;
89
+        }
90
+
91
+        $user = $this->provider->retrieveByCredentials($credentials);
92
+
93
+        if ($user instanceof Authenticatable && $this->provider->validateCredentials($user, $credentials)) {
94
+            $this->setUser($user);
95
+
96
+            return true;
97
+        }
98
+
99
+        return false;
100
+    }
101
+
102
+    /**
103
+     * Set the current user.
104
+     *
105
+     * @param  \Illuminate\Contracts\Auth\Authenticatable $user
106
+     * @return void
107
+     */
108
+    public function setUser(Authenticatable $user)
109
+    {
110
+        $this->user = $user;
111
+    }
112
+}

+ 94
- 0
app/User.php View File

@@ -0,0 +1,94 @@
1
+<?php
2
+
3
+namespace App;
4
+
5
+use Illuminate\Contracts\Auth\Authenticatable;
6
+use Illuminate\Database\Eloquent\Model;
7
+
8
+class User extends Model implements Authenticatable
9
+{
10
+
11
+    /**
12
+     * The table associated with the model.
13
+     *
14
+     * @var string
15
+     */
16
+    protected $table = 'users';
17
+
18
+    protected $fillable = ["email"];
19
+    
20
+	public static $rules = [
21
+		"email" => "required",
22
+	];
23
+
24
+    /**
25
+     * @return string
26
+     *
27
+     * @throws \Exception
28
+     */
29
+    public static function generateToken()
30
+    {
31
+        return bin2hex(random_bytes(72));
32
+	}
33
+
34
+    /**
35
+     * Get the name of the unique identifier for the user.
36
+     *
37
+     * @return string
38
+     */
39
+    public function getAuthIdentifierName()
40
+    {
41
+        return 'api_token';
42
+    }
43
+
44
+    /**
45
+     * Get the unique identifier for the user.
46
+     *
47
+     * @return mixed
48
+     */
49
+    public function getAuthIdentifier()
50
+    {
51
+        return $this->{$this->getAuthIdentifierName()};
52
+    }
53
+
54
+    /**
55
+     * Get the password for the user.
56
+     *
57
+     * @return string
58
+     */
59
+    public function getAuthPassword()
60
+    {
61
+        return $this->api_token;
62
+    }
63
+
64
+    /**
65
+     * Get the token value for the "remember me" session.
66
+     *
67
+     * @return string
68
+     */
69
+    public function getRememberToken()
70
+    {
71
+        return null;
72
+    }
73
+
74
+    /**
75
+     * Set the token value for the "remember me" session.
76
+     *
77
+     * @param  string $value
78
+     * @return void
79
+     */
80
+    public function setRememberToken($value)
81
+    {
82
+        return null;
83
+    }
84
+
85
+    /**
86
+     * Get the column name for the "remember me" token.
87
+     *
88
+     * @return string
89
+     */
90
+    public function getRememberTokenName()
91
+    {
92
+        return null;
93
+    }
94
+}

+ 53
- 0
artisan View File

@@ -0,0 +1,53 @@
1
+#!/usr/bin/env php
2
+<?php
3
+
4
+define('LARAVEL_START', microtime(true));
5
+
6
+/*
7
+|--------------------------------------------------------------------------
8
+| Register The Auto Loader
9
+|--------------------------------------------------------------------------
10
+|
11
+| Composer provides a convenient, automatically generated class loader
12
+| for our application. We just need to utilize it! We'll require it
13
+| into the script here so that we do not have to worry about the
14
+| loading of any our classes "manually". Feels great to relax.
15
+|
16
+*/
17
+
18
+require __DIR__.'/vendor/autoload.php';
19
+
20
+$app = require_once __DIR__.'/bootstrap/app.php';
21
+
22
+/*
23
+|--------------------------------------------------------------------------
24
+| Run The Artisan Application
25
+|--------------------------------------------------------------------------
26
+|
27
+| When we run the console application, the current CLI command will be
28
+| executed in this console and the response sent back to a terminal
29
+| or another output device for the developers. Here goes nothing!
30
+|
31
+*/
32
+
33
+$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
34
+
35
+$status = $kernel->handle(
36
+    $input = new Symfony\Component\Console\Input\ArgvInput,
37
+    new Symfony\Component\Console\Output\ConsoleOutput
38
+);
39
+
40
+/*
41
+|--------------------------------------------------------------------------
42
+| Shutdown The Application
43
+|--------------------------------------------------------------------------
44
+|
45
+| Once Artisan has finished running, we will fire off the shutdown events
46
+| so that any final work may be done by the application before we shut
47
+| down the process. This is the last thing to happen to the request.
48
+|
49
+*/
50
+
51
+$kernel->terminate($input, $status);
52
+
53
+exit($status);

+ 55
- 0
bootstrap/app.php View File

@@ -0,0 +1,55 @@
1
+<?php
2
+
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Create The Application
6
+|--------------------------------------------------------------------------
7
+|
8
+| The first thing we will do is create a new Laravel application instance
9
+| which serves as the "glue" for all the components of Laravel, and is
10
+| the IoC container for the system binding all of the various parts.
11
+|
12
+*/
13
+
14
+$app = new Illuminate\Foundation\Application(
15
+    dirname(__DIR__)
16
+);
17
+
18
+/*
19
+|--------------------------------------------------------------------------
20
+| Bind Important Interfaces
21
+|--------------------------------------------------------------------------
22
+|
23
+| Next, we need to bind some important interfaces into the container so
24
+| we will be able to resolve them when needed. The kernels serve the
25
+| incoming requests to this application from both the web and CLI.
26
+|
27
+*/
28
+
29
+$app->singleton(
30
+    Illuminate\Contracts\Http\Kernel::class,
31
+    App\Http\Kernel::class
32
+);
33
+
34
+$app->singleton(
35
+    Illuminate\Contracts\Console\Kernel::class,
36
+    App\Console\Kernel::class
37
+);
38
+
39
+$app->singleton(
40
+    Illuminate\Contracts\Debug\ExceptionHandler::class,
41
+    App\Exceptions\Handler::class
42
+);
43
+
44
+/*
45
+|--------------------------------------------------------------------------
46
+| Return The Application
47
+|--------------------------------------------------------------------------
48
+|
49
+| This script returns the application instance. The instance is given to
50
+| the calling script so we can separate the building of the instances
51
+| from the actual running of the application and sending responses.
52
+|
53
+*/
54
+
55
+return $app;

+ 2
- 0
bootstrap/cache/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 61
- 0
composer.json View File

@@ -0,0 +1,61 @@
1
+{
2
+    "name": "laravel/laravel",
3
+    "description": "The Laravel Framework.",
4
+    "keywords": ["framework", "laravel"],
5
+    "license": "MIT",
6
+    "type": "project",
7
+    "require": {
8
+        "php": "^7.1.3",
9
+        "fideloper/proxy": "^4.0",
10
+        "guzzlehttp/guzzle": "^6.3",
11
+        "laravel/framework": "5.7.*",
12
+        "laravel/tinker": "^1.0"
13
+    },
14
+    "require-dev": {
15
+        "beyondcode/laravel-dump-server": "^1.0",
16
+        "filp/whoops": "^2.0",
17
+        "fzaninotto/faker": "^1.4",
18
+        "mockery/mockery": "^1.0",
19
+        "nunomaduro/collision": "^2.0",
20
+        "phpunit/phpunit": "^7.0"
21
+    },
22
+    "autoload": {
23
+        "classmap": [
24
+            "database/seeds",
25
+            "database/factories"
26
+        ],
27
+        "psr-4": {
28
+            "App\\": "app/"
29
+        }
30
+    },
31
+    "autoload-dev": {
32
+        "psr-4": {
33
+            "Tests\\": "tests/"
34
+        }
35
+    },
36
+    "extra": {
37
+        "laravel": {
38
+            "dont-discover": [
39
+            ]
40
+        }
41
+    },
42
+    "scripts": {
43
+        "post-root-package-install": [
44
+            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
45
+        ],
46
+        "post-create-project-cmd": [
47
+            "@php artisan key:generate --ansi"
48
+        ],
49
+        "post-autoload-dump": [
50
+            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
51
+            "@php artisan package:discover --ansi"
52
+        ]
53
+    },
54
+    "config": {
55
+        "preferred-install": "dist",
56
+        "sort-packages": true,
57
+        "optimize-autoloader": true
58
+    },
59
+    "minimum-stability": "dev",
60
+    "prefer-stable": true
61
+}

+ 4361
- 0
composer.lock
File diff suppressed because it is too large
View File


+ 227
- 0
config/app.php View File

@@ -0,0 +1,227 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Application Name
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This value is the name of your application. This value is used when the
11
+    | framework needs to place the application's name in a notification or
12
+    | any other location as required by the application or its packages.
13
+    |
14
+    */
15
+
16
+    'name' => env('APP_NAME', 'Laravel'),
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Application Environment
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | This value determines the "environment" your application is currently
24
+    | running in. This may determine how you prefer to configure various
25
+    | services the application utilizes. Set this in your ".env" file.
26
+    |
27
+    */
28
+
29
+    'env' => env('APP_ENV', 'production'),
30
+
31
+    /*
32
+    |--------------------------------------------------------------------------
33
+    | Application Debug Mode
34
+    |--------------------------------------------------------------------------
35
+    |
36
+    | When your application is in debug mode, detailed error messages with
37
+    | stack traces will be shown on every error that occurs within your
38
+    | application. If disabled, a simple generic error page is shown.
39
+    |
40
+    */
41
+
42
+    'debug' => env('APP_DEBUG', false),
43
+
44
+    /*
45
+    |--------------------------------------------------------------------------
46
+    | Application URL
47
+    |--------------------------------------------------------------------------
48
+    |
49
+    | This URL is used by the console to properly generate URLs when using
50
+    | the Artisan command line tool. You should set this to the root of
51
+    | your application so that it is used when running Artisan tasks.
52
+    |
53
+    */
54
+
55
+    'url' => env('APP_URL', 'http://localhost'),
56
+
57
+    /*
58
+    |--------------------------------------------------------------------------
59
+    | Application Timezone
60
+    |--------------------------------------------------------------------------
61
+    |
62
+    | Here you may specify the default timezone for your application, which
63
+    | will be used by the PHP date and date-time functions. We have gone
64
+    | ahead and set this to a sensible default for you out of the box.
65
+    |
66
+    */
67
+
68
+    'timezone' => 'UTC',
69
+
70
+    /*
71
+    |--------------------------------------------------------------------------
72
+    | Application Locale Configuration
73
+    |--------------------------------------------------------------------------
74
+    |
75
+    | The application locale determines the default locale that will be used
76
+    | by the translation service provider. You are free to set this value
77
+    | to any of the locales which will be supported by the application.
78
+    |
79
+    */
80
+
81
+    'locale' => 'en',
82
+
83
+    /*
84
+    |--------------------------------------------------------------------------
85
+    | Application Fallback Locale
86
+    |--------------------------------------------------------------------------
87
+    |
88
+    | The fallback locale determines the locale to use when the current one
89
+    | is not available. You may change the value to correspond to any of
90
+    | the language folders that are provided through your application.
91
+    |
92
+    */
93
+
94
+    'fallback_locale' => 'en',
95
+
96
+    /*
97
+    |--------------------------------------------------------------------------
98
+    | Faker Locale
99
+    |--------------------------------------------------------------------------
100
+    |
101
+    | This locale will be used by the Faker PHP library when generating fake
102
+    | data for your database seeds. For example, this will be used to get
103
+    | localized telephone numbers, street address information and more.
104
+    |
105
+    */
106
+
107
+    'faker_locale' => 'en_US',
108
+
109
+    /*
110
+    |--------------------------------------------------------------------------
111
+    | Encryption Key
112
+    |--------------------------------------------------------------------------
113
+    |
114
+    | This key is used by the Illuminate encrypter service and should be set
115
+    | to a random, 32 character string, otherwise these encrypted strings
116
+    | will not be safe. Please do this before deploying an application!
117
+    |
118
+    */
119
+
120
+    'key' => env('APP_KEY'),
121
+
122
+    'cipher' => 'AES-256-CBC',
123
+
124
+    /*
125
+    |--------------------------------------------------------------------------
126
+    | Autoloaded Service Providers
127
+    |--------------------------------------------------------------------------
128
+    |
129
+    | The service providers listed here will be automatically loaded on the
130
+    | request to your application. Feel free to add your own services to
131
+    | this array to grant expanded functionality to your applications.
132
+    |
133
+    */
134
+
135
+    'providers' => [
136
+
137
+        /*
138
+         * Laravel Framework Service Providers...
139
+         */
140
+        Illuminate\Auth\AuthServiceProvider::class,
141
+        Illuminate\Broadcasting\BroadcastServiceProvider::class,
142
+        Illuminate\Bus\BusServiceProvider::class,
143
+        Illuminate\Cache\CacheServiceProvider::class,
144
+        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
145
+        Illuminate\Cookie\CookieServiceProvider::class,
146
+        Illuminate\Database\DatabaseServiceProvider::class,
147
+        Illuminate\Encryption\EncryptionServiceProvider::class,
148
+        Illuminate\Filesystem\FilesystemServiceProvider::class,
149
+        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
150
+        Illuminate\Hashing\HashServiceProvider::class,
151
+        Illuminate\Mail\MailServiceProvider::class,
152
+        Illuminate\Notifications\NotificationServiceProvider::class,
153
+        Illuminate\Pagination\PaginationServiceProvider::class,
154
+        Illuminate\Pipeline\PipelineServiceProvider::class,
155
+        Illuminate\Queue\QueueServiceProvider::class,
156
+        Illuminate\Redis\RedisServiceProvider::class,
157
+        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
158
+        Illuminate\Session\SessionServiceProvider::class,
159
+        Illuminate\Translation\TranslationServiceProvider::class,
160
+        Illuminate\Validation\ValidationServiceProvider::class,
161
+        Illuminate\View\ViewServiceProvider::class,
162
+
163
+        /*
164
+         * Package Service Providers...
165
+         */
166
+
167
+        /*
168
+         * Application Service Providers...
169
+         */
170
+        App\Providers\AppServiceProvider::class,
171
+        App\Providers\AuthServiceProvider::class,
172
+        // App\Providers\BroadcastServiceProvider::class,
173
+        App\Providers\EventServiceProvider::class,
174
+        App\Providers\RouteServiceProvider::class,
175
+
176
+    ],
177
+
178
+    /*
179
+    |--------------------------------------------------------------------------
180
+    | Class Aliases
181
+    |--------------------------------------------------------------------------
182
+    |
183
+    | This array of class aliases will be registered when this application
184
+    | is started. However, feel free to register as many as you wish as
185
+    | the aliases are "lazy" loaded so they don't hinder performance.
186
+    |
187
+    */
188
+
189
+    'aliases' => [
190
+
191
+        'App' => Illuminate\Support\Facades\App::class,
192
+        'Artisan' => Illuminate\Support\Facades\Artisan::class,
193
+        'Auth' => Illuminate\Support\Facades\Auth::class,
194
+        'Blade' => Illuminate\Support\Facades\Blade::class,
195
+        'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
196
+        'Bus' => Illuminate\Support\Facades\Bus::class,
197
+        'Cache' => Illuminate\Support\Facades\Cache::class,
198
+        'Config' => Illuminate\Support\Facades\Config::class,
199
+        'Cookie' => Illuminate\Support\Facades\Cookie::class,
200
+        'Crypt' => Illuminate\Support\Facades\Crypt::class,
201
+        'DB' => Illuminate\Support\Facades\DB::class,
202
+        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
203
+        'Event' => Illuminate\Support\Facades\Event::class,
204
+        'File' => Illuminate\Support\Facades\File::class,
205
+        'Gate' => Illuminate\Support\Facades\Gate::class,
206
+        'Hash' => Illuminate\Support\Facades\Hash::class,
207
+        'Lang' => Illuminate\Support\Facades\Lang::class,
208
+        'Log' => Illuminate\Support\Facades\Log::class,
209
+        'Mail' => Illuminate\Support\Facades\Mail::class,
210
+        'Notification' => Illuminate\Support\Facades\Notification::class,
211
+        'Password' => Illuminate\Support\Facades\Password::class,
212
+        'Queue' => Illuminate\Support\Facades\Queue::class,
213
+        'Redirect' => Illuminate\Support\Facades\Redirect::class,
214
+        'Redis' => Illuminate\Support\Facades\Redis::class,
215
+        'Request' => Illuminate\Support\Facades\Request::class,
216
+        'Response' => Illuminate\Support\Facades\Response::class,
217
+        'Route' => Illuminate\Support\Facades\Route::class,
218
+        'Schema' => Illuminate\Support\Facades\Schema::class,
219
+        'Session' => Illuminate\Support\Facades\Session::class,
220
+        'Storage' => Illuminate\Support\Facades\Storage::class,
221
+        'URL' => Illuminate\Support\Facades\URL::class,
222
+        'Validator' => Illuminate\Support\Facades\Validator::class,
223
+        'View' => Illuminate\Support\Facades\View::class,
224
+
225
+    ],
226
+
227
+];

+ 102
- 0
config/auth.php View File

@@ -0,0 +1,102 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Authentication Defaults
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This option controls the default authentication "guard" and password
11
+    | reset options for your application. You may change these defaults
12
+    | as required, but they're a perfect start for most applications.
13
+    |
14
+    */
15
+
16
+    'defaults' => [
17
+        'guard' => 'api',
18
+        'passwords' => 'users',
19
+    ],
20
+
21
+    /*
22
+    |--------------------------------------------------------------------------
23
+    | Authentication Guards
24
+    |--------------------------------------------------------------------------
25
+    |
26
+    | Next, you may define every authentication guard for your application.
27
+    | Of course, a great default configuration has been defined for you
28
+    | here which uses session storage and the Eloquent user provider.
29
+    |
30
+    | All authentication drivers have a user provider. This defines how the
31
+    | users are actually retrieved out of your database or other storage
32
+    | mechanisms used by this application to persist your user's data.
33
+    |
34
+    | Supported: "session", "token"
35
+    |
36
+    */
37
+
38
+    'guards' => [
39
+        'web' => [
40
+            'driver' => 'token',
41
+            'provider' => 'users',
42
+        ],
43
+
44
+        'api' => [
45
+            'driver' => 'token',
46
+            'provider' => 'users',
47
+        ],
48
+    ],
49
+
50
+    /*
51
+    |--------------------------------------------------------------------------
52
+    | User Providers
53
+    |--------------------------------------------------------------------------
54
+    |
55
+    | All authentication drivers have a user provider. This defines how the
56
+    | users are actually retrieved out of your database or other storage
57
+    | mechanisms used by this application to persist your user's data.
58
+    |
59
+    | If you have multiple user tables or models you may configure multiple
60
+    | sources which represent each model / table. These sources may then
61
+    | be assigned to any extra authentication guards you have defined.
62
+    |
63
+    | Supported: "database", "eloquent"
64
+    |
65
+    */
66
+
67
+    'providers' => [
68
+        'users' => [
69
+            'driver' => 'eloquent',
70
+            'model' => App\User::class,
71
+        ],
72
+
73
+        // 'users' => [
74
+        //     'driver' => 'database',
75
+        //     'table' => 'users',
76
+        // ],
77
+    ],
78
+
79
+    /*
80
+    |--------------------------------------------------------------------------
81
+    | Resetting Passwords
82
+    |--------------------------------------------------------------------------
83
+    |
84
+    | You may specify multiple password reset configurations if you have more
85
+    | than one user table or model in the application and you want to have
86
+    | separate password reset settings based on the specific user types.
87
+    |
88
+    | The expire time is the number of minutes that the reset token should be
89
+    | considered valid. This security feature keeps tokens short-lived so
90
+    | they have less time to be guessed. You may change this as needed.
91
+    |
92
+    */
93
+
94
+    'passwords' => [
95
+        'users' => [
96
+            'provider' => 'users',
97
+            'table' => 'password_resets',
98
+            'expire' => 60,
99
+        ],
100
+    ],
101
+
102
+];

+ 59
- 0
config/broadcasting.php View File

@@ -0,0 +1,59 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Broadcaster
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This option controls the default broadcaster that will be used by the
11
+    | framework when an event needs to be broadcast. You may set this to
12
+    | any of the connections defined in the "connections" array below.
13
+    |
14
+    | Supported: "pusher", "redis", "log", "null"
15
+    |
16
+    */
17
+
18
+    'default' => env('BROADCAST_DRIVER', 'null'),
19
+
20
+    /*
21
+    |--------------------------------------------------------------------------
22
+    | Broadcast Connections
23
+    |--------------------------------------------------------------------------
24
+    |
25
+    | Here you may define all of the broadcast connections that will be used
26
+    | to broadcast events to other systems or over websockets. Samples of
27
+    | each available type of connection are provided inside this array.
28
+    |
29
+    */
30
+
31
+    'connections' => [
32
+
33
+        'pusher' => [
34
+            'driver' => 'pusher',
35
+            'key' => env('PUSHER_APP_KEY'),
36
+            'secret' => env('PUSHER_APP_SECRET'),
37
+            'app_id' => env('PUSHER_APP_ID'),
38
+            'options' => [
39
+                'cluster' => env('PUSHER_APP_CLUSTER'),
40
+                'encrypted' => true,
41
+            ],
42
+        ],
43
+
44
+        'redis' => [
45
+            'driver' => 'redis',
46
+            'connection' => 'default',
47
+        ],
48
+
49
+        'log' => [
50
+            'driver' => 'log',
51
+        ],
52
+
53
+        'null' => [
54
+            'driver' => 'null',
55
+        ],
56
+
57
+    ],
58
+
59
+];

+ 93
- 0
config/cache.php View File

@@ -0,0 +1,93 @@
1
+<?php
2
+
3
+use Illuminate\Support\Str;
4
+
5
+return [
6
+
7
+    /*
8
+    |--------------------------------------------------------------------------
9
+    | Default Cache Store
10
+    |--------------------------------------------------------------------------
11
+    |
12
+    | This option controls the default cache connection that gets used while
13
+    | using this caching library. This connection is used when another is
14
+    | not explicitly specified when executing a given caching function.
15
+    |
16
+    | Supported: "apc", "array", "database", "file", "memcached", "redis"
17
+    |
18
+    */
19
+
20
+    'default' => env('CACHE_DRIVER', 'file'),
21
+
22
+    /*
23
+    |--------------------------------------------------------------------------
24
+    | Cache Stores
25
+    |--------------------------------------------------------------------------
26
+    |
27
+    | Here you may define all of the cache "stores" for your application as
28
+    | well as their drivers. You may even define multiple stores for the
29
+    | same cache driver to group types of items stored in your caches.
30
+    |
31
+    */
32
+
33
+    'stores' => [
34
+
35
+        'apc' => [
36
+            'driver' => 'apc',
37
+        ],
38
+
39
+        'array' => [
40
+            'driver' => 'array',
41
+        ],
42
+
43
+        'database' => [
44
+            'driver' => 'database',
45
+            'table' => 'cache',
46
+            'connection' => null,
47
+        ],
48
+
49
+        'file' => [
50
+            'driver' => 'file',
51
+            'path' => storage_path('framework/cache/data'),
52
+        ],
53
+
54
+        'memcached' => [
55
+            'driver' => 'memcached',
56
+            'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
57
+            'sasl' => [
58
+                env('MEMCACHED_USERNAME'),
59
+                env('MEMCACHED_PASSWORD'),
60
+            ],
61
+            'options' => [
62
+                // Memcached::OPT_CONNECT_TIMEOUT  => 2000,
63
+            ],
64
+            'servers' => [
65
+                [
66
+                    'host' => env('MEMCACHED_HOST', '127.0.0.1'),
67
+                    'port' => env('MEMCACHED_PORT', 11211),
68
+                    'weight' => 100,
69
+                ],
70
+            ],
71
+        ],
72
+
73
+        'redis' => [
74
+            'driver' => 'redis',
75
+            'connection' => 'cache',
76
+        ],
77
+
78
+    ],
79
+
80
+    /*
81
+    |--------------------------------------------------------------------------
82
+    | Cache Key Prefix
83
+    |--------------------------------------------------------------------------
84
+    |
85
+    | When utilizing a RAM based store such as APC or Memcached, there might
86
+    | be other applications utilizing the same cache. So, we'll specify a
87
+    | value to get prefixed to all our keys so we can avoid collisions.
88
+    |
89
+    */
90
+
91
+    'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
92
+
93
+];

+ 130
- 0
config/database.php View File

@@ -0,0 +1,130 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Database Connection Name
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Here you may specify which of the database connections below you wish
11
+    | to use as your default connection for all database work. Of course
12
+    | you may use many connections at once using the Database library.
13
+    |
14
+    */
15
+
16
+    'default' => env('DB_CONNECTION', 'mysql'),
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Database Connections
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | Here are each of the database connections setup for your application.
24
+    | Of course, examples of configuring each database platform that is
25
+    | supported by Laravel is shown below to make development simple.
26
+    |
27
+    |
28
+    | All database work in Laravel is done through the PHP PDO facilities
29
+    | so make sure you have the driver for your particular database of
30
+    | choice installed on your machine before you begin development.
31
+    |
32
+    */
33
+
34
+    'connections' => [
35
+
36
+        'sqlite' => [
37
+            'driver' => 'sqlite',
38
+            'database' => env('DB_DATABASE', database_path('database.sqlite')),
39
+            'prefix' => '',
40
+        ],
41
+
42
+        'mysql' => [
43
+            'driver' => 'mysql',
44
+            'host' => env('DB_HOST', '127.0.0.1'),
45
+            'port' => env('DB_PORT', '3306'),
46
+            'database' => env('DB_DATABASE', 'forge'),
47
+            'username' => env('DB_USERNAME', 'forge'),
48
+            'password' => env('DB_PASSWORD', ''),
49
+            'unix_socket' => env('DB_SOCKET', ''),
50
+            'charset' => 'utf8mb4',
51
+            'collation' => 'utf8mb4_unicode_ci',
52
+            'prefix' => '',
53
+            'prefix_indexes' => true,
54
+            'strict' => true,
55
+            'engine' => null,
56
+        ],
57
+
58
+        'pgsql' => [
59
+            'driver' => 'pgsql',
60
+            'host' => env('DB_HOST', '127.0.0.1'),
61
+            'port' => env('DB_PORT', '5432'),
62
+            'database' => env('DB_DATABASE', 'forge'),
63
+            'username' => env('DB_USERNAME', 'forge'),
64
+            'password' => env('DB_PASSWORD', ''),
65
+            'charset' => 'utf8',
66
+            'prefix' => '',
67
+            'prefix_indexes' => true,
68
+            'schema' => 'public',
69
+            'sslmode' => 'prefer',
70
+        ],
71
+
72
+        'sqlsrv' => [
73
+            'driver' => 'sqlsrv',
74
+            'host' => env('DB_HOST', 'localhost'),
75
+            'port' => env('DB_PORT', '1433'),
76
+            'database' => env('DB_DATABASE', 'forge'),
77
+            'username' => env('DB_USERNAME', 'forge'),
78
+            'password' => env('DB_PASSWORD', ''),
79
+            'charset' => 'utf8',
80
+            'prefix' => '',
81
+            'prefix_indexes' => true,
82
+        ],
83
+
84
+    ],
85
+
86
+    /*
87
+    |--------------------------------------------------------------------------
88
+    | Migration Repository Table
89
+    |--------------------------------------------------------------------------
90
+    |
91
+    | This table keeps track of all the migrations that have already run for
92
+    | your application. Using this information, we can determine which of
93
+    | the migrations on disk haven't actually been run in the database.
94
+    |
95
+    */
96
+
97
+    'migrations' => 'migrations',
98
+
99
+    /*
100
+    |--------------------------------------------------------------------------
101
+    | Redis Databases
102
+    |--------------------------------------------------------------------------
103
+    |
104
+    | Redis is an open source, fast, and advanced key-value store that also
105
+    | provides a richer set of commands than a typical key-value systems
106
+    | such as APC or Memcached. Laravel makes it easy to dig right in.
107
+    |
108
+    */
109
+
110
+    'redis' => [
111
+
112
+        'client' => 'predis',
113
+
114
+        'default' => [
115
+            'host' => env('REDIS_HOST', '127.0.0.1'),
116
+            'password' => env('REDIS_PASSWORD', null),
117
+            'port' => env('REDIS_PORT', 6379),
118
+            'database' => env('REDIS_DB', 0),
119
+        ],
120
+
121
+        'cache' => [
122
+            'host' => env('REDIS_HOST', '127.0.0.1'),
123
+            'password' => env('REDIS_PASSWORD', null),
124
+            'port' => env('REDIS_PORT', 6379),
125
+            'database' => env('REDIS_CACHE_DB', 1),
126
+        ],
127
+
128
+    ],
129
+
130
+];

+ 69
- 0
config/filesystems.php View File

@@ -0,0 +1,69 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Filesystem Disk
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Here you may specify the default filesystem disk that should be used
11
+    | by the framework. The "local" disk, as well as a variety of cloud
12
+    | based disks are available to your application. Just store away!
13
+    |
14
+    */
15
+
16
+    'default' => env('FILESYSTEM_DRIVER', 'local'),
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Default Cloud Filesystem Disk
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | Many applications store files both locally and in the cloud. For this
24
+    | reason, you may specify a default "cloud" driver here. This driver
25
+    | will be bound as the Cloud disk implementation in the container.
26
+    |
27
+    */
28
+
29
+    'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30
+
31
+    /*
32
+    |--------------------------------------------------------------------------
33
+    | Filesystem Disks
34
+    |--------------------------------------------------------------------------
35
+    |
36
+    | Here you may configure as many filesystem "disks" as you wish, and you
37
+    | may even configure multiple disks of the same driver. Defaults have
38
+    | been setup for each driver as an example of the required options.
39
+    |
40
+    | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
41
+    |
42
+    */
43
+
44
+    'disks' => [
45
+
46
+        'local' => [
47
+            'driver' => 'local',
48
+            'root' => storage_path('app'),
49
+        ],
50
+
51
+        'public' => [
52
+            'driver' => 'local',
53
+            'root' => storage_path('app/public'),
54
+            'url' => env('APP_URL').'/storage',
55
+            'visibility' => 'public',
56
+        ],
57
+
58
+        's3' => [
59
+            'driver' => 's3',
60
+            'key' => env('AWS_ACCESS_KEY_ID'),
61
+            'secret' => env('AWS_SECRET_ACCESS_KEY'),
62
+            'region' => env('AWS_DEFAULT_REGION'),
63
+            'bucket' => env('AWS_BUCKET'),
64
+            'url' => env('AWS_URL'),
65
+        ],
66
+
67
+    ],
68
+
69
+];

+ 52
- 0
config/hashing.php View File

@@ -0,0 +1,52 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Hash Driver
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This option controls the default hash driver that will be used to hash
11
+    | passwords for your application. By default, the bcrypt algorithm is
12
+    | used; however, you remain free to modify this option if you wish.
13
+    |
14
+    | Supported: "bcrypt", "argon", "argon2id"
15
+    |
16
+    */
17
+
18
+    'driver' => 'bcrypt',
19
+
20
+    /*
21
+    |--------------------------------------------------------------------------
22
+    | Bcrypt Options
23
+    |--------------------------------------------------------------------------
24
+    |
25
+    | Here you may specify the configuration options that should be used when
26
+    | passwords are hashed using the Bcrypt algorithm. This will allow you
27
+    | to control the amount of time it takes to hash the given password.
28
+    |
29
+    */
30
+
31
+    'bcrypt' => [
32
+        'rounds' => env('BCRYPT_ROUNDS', 10),
33
+    ],
34
+
35
+    /*
36
+    |--------------------------------------------------------------------------
37
+    | Argon Options
38
+    |--------------------------------------------------------------------------
39
+    |
40
+    | Here you may specify the configuration options that should be used when
41
+    | passwords are hashed using the Argon algorithm. These will allow you
42
+    | to control the amount of time it takes to hash the given password.
43
+    |
44
+    */
45
+
46
+    'argon' => [
47
+        'memory' => 1024,
48
+        'threads' => 2,
49
+        'time' => 2,
50
+    ],
51
+
52
+];

+ 92
- 0
config/logging.php View File

@@ -0,0 +1,92 @@
1
+<?php
2
+
3
+use Monolog\Handler\StreamHandler;
4
+use Monolog\Handler\SyslogUdpHandler;
5
+
6
+return [
7
+
8
+    /*
9
+    |--------------------------------------------------------------------------
10
+    | Default Log Channel
11
+    |--------------------------------------------------------------------------
12
+    |
13
+    | This option defines the default log channel that gets used when writing
14
+    | messages to the logs. The name specified in this option should match
15
+    | one of the channels defined in the "channels" configuration array.
16
+    |
17
+    */
18
+
19
+    'default' => env('LOG_CHANNEL', 'stack'),
20
+
21
+    /*
22
+    |--------------------------------------------------------------------------
23
+    | Log Channels
24
+    |--------------------------------------------------------------------------
25
+    |
26
+    | Here you may configure the log channels for your application. Out of
27
+    | the box, Laravel uses the Monolog PHP logging library. This gives
28
+    | you a variety of powerful log handlers / formatters to utilize.
29
+    |
30
+    | Available Drivers: "single", "daily", "slack", "syslog",
31
+    |                    "errorlog", "monolog",
32
+    |                    "custom", "stack"
33
+    |
34
+    */
35
+
36
+    'channels' => [
37
+        'stack' => [
38
+            'driver' => 'stack',
39
+            'channels' => ['daily'],
40
+        ],
41
+
42
+        'single' => [
43
+            'driver' => 'single',
44
+            'path' => storage_path('logs/laravel.log'),
45
+            'level' => 'debug',
46
+        ],
47
+
48
+        'daily' => [
49
+            'driver' => 'daily',
50
+            'path' => storage_path('logs/laravel.log'),
51
+            'level' => 'debug',
52
+            'days' => 14,
53
+        ],
54
+
55
+        'slack' => [
56
+            'driver' => 'slack',
57
+            'url' => env('LOG_SLACK_WEBHOOK_URL'),
58
+            'username' => 'Laravel Log',
59
+            'emoji' => ':boom:',
60
+            'level' => 'critical',
61
+        ],
62
+
63
+        'papertrail' => [
64
+            'driver'  => 'monolog',
65
+            'level' => 'debug',
66
+            'handler' => SyslogUdpHandler::class,
67
+            'handler_with' => [
68
+                'host' => env('PAPERTRAIL_URL'),
69
+                'port' => env('PAPERTRAIL_PORT'),
70
+            ],
71
+        ],
72
+
73
+        'stderr' => [
74
+            'driver' => 'monolog',
75
+            'handler' => StreamHandler::class,
76
+            'with' => [
77
+                'stream' => 'php://stderr',
78
+            ],
79
+        ],
80
+
81
+        'syslog' => [
82
+            'driver' => 'syslog',
83
+            'level' => 'debug',
84
+        ],
85
+
86
+        'errorlog' => [
87
+            'driver' => 'errorlog',
88
+            'level' => 'debug',
89
+        ],
90
+    ],
91
+
92
+];

+ 123
- 0
config/mail.php View File

@@ -0,0 +1,123 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Mail Driver
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Laravel supports both SMTP and PHP's "mail" function as drivers for the
11
+    | sending of e-mail. You may specify which one you're using throughout
12
+    | your application here. By default, Laravel is setup for SMTP mail.
13
+    |
14
+    | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
15
+    |            "sparkpost", "log", "array"
16
+    |
17
+    */
18
+
19
+    'driver' => env('MAIL_DRIVER', 'sendmail'),
20
+
21
+    /*
22
+    |--------------------------------------------------------------------------
23
+    | SMTP Host Address
24
+    |--------------------------------------------------------------------------
25
+    |
26
+    | Here you may provide the host address of the SMTP server used by your
27
+    | applications. A default option is provided that is compatible with
28
+    | the Mailgun mail service which will provide reliable deliveries.
29
+    |
30
+    */
31
+
32
+    'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
33
+
34
+    /*
35
+    |--------------------------------------------------------------------------
36
+    | SMTP Host Port
37
+    |--------------------------------------------------------------------------
38
+    |
39
+    | This is the SMTP port used by your application to deliver e-mails to
40
+    | users of the application. Like the host we have set this value to
41
+    | stay compatible with the Mailgun e-mail application by default.
42
+    |
43
+    */
44
+
45
+    'port' => env('MAIL_PORT', 587),
46
+
47
+    /*
48
+    |--------------------------------------------------------------------------
49
+    | Global "From" Address
50
+    |--------------------------------------------------------------------------
51
+    |
52
+    | You may wish for all e-mails sent by your application to be sent from
53
+    | the same address. Here, you may specify a name and address that is
54
+    | used globally for all e-mails that are sent by your application.
55
+    |
56
+    */
57
+
58
+    'from' => [
59
+        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
60
+        'name' => env('MAIL_FROM_NAME', 'Example'),
61
+    ],
62
+
63
+    /*
64
+    |--------------------------------------------------------------------------
65
+    | E-Mail Encryption Protocol
66
+    |--------------------------------------------------------------------------
67
+    |
68
+    | Here you may specify the encryption protocol that should be used when
69
+    | the application send e-mail messages. A sensible default using the
70
+    | transport layer security protocol should provide great security.
71
+    |
72
+    */
73
+
74
+    'encryption' => env('MAIL_ENCRYPTION', 'tls'),
75
+
76
+    /*
77
+    |--------------------------------------------------------------------------
78
+    | SMTP Server Username
79
+    |--------------------------------------------------------------------------
80
+    |
81
+    | If your SMTP server requires a username for authentication, you should
82
+    | set it here. This will get used to authenticate with your server on
83
+    | connection. You may also set the "password" value below this one.
84
+    |
85
+    */
86
+
87
+    'username' => env('MAIL_USERNAME'),
88
+
89
+    'password' => env('MAIL_PASSWORD'),
90
+
91
+    /*
92
+    |--------------------------------------------------------------------------
93
+    | Sendmail System Path
94
+    |--------------------------------------------------------------------------
95
+    |
96
+    | When using the "sendmail" driver to send e-mails, we will need to know
97
+    | the path to where Sendmail lives on this server. A default path has
98
+    | been provided here, which will work well on most of your systems.
99
+    |
100
+    */
101
+
102
+    'sendmail' => '/usr/sbin/sendmail -bs',
103
+
104
+    /*
105
+    |--------------------------------------------------------------------------
106
+    | Markdown Mail Settings
107
+    |--------------------------------------------------------------------------
108
+    |
109
+    | If you are using Markdown based email rendering, you may configure your
110
+    | theme and component paths here, allowing you to customize the design
111
+    | of the emails. Or, you may simply stick with the Laravel defaults!
112
+    |
113
+    */
114
+
115
+    'markdown' => [
116
+        'theme' => 'default',
117
+
118
+        'paths' => [
119
+            resource_path('views/vendor/mail'),
120
+        ],
121
+    ],
122
+
123
+];

+ 86
- 0
config/queue.php View File

@@ -0,0 +1,86 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Queue Connection Name
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Laravel's queue API supports an assortment of back-ends via a single
11
+    | API, giving you convenient access to each back-end using the same
12
+    | syntax for every one. Here you may define a default connection.
13
+    |
14
+    */
15
+
16
+    'default' => env('QUEUE_CONNECTION', 'sync'),
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Queue Connections
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | Here you may configure the connection information for each server that
24
+    | is used by your application. A default configuration has been added
25
+    | for each back-end shipped with Laravel. You are free to add more.
26
+    |
27
+    | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28
+    |
29
+    */
30
+
31
+    'connections' => [
32
+
33
+        'sync' => [
34
+            'driver' => 'sync',
35
+        ],
36
+
37
+        'database' => [
38
+            'driver' => 'database',
39
+            'table' => 'jobs',
40
+            'queue' => 'default',
41
+            'retry_after' => 90,
42
+        ],
43
+
44
+        'beanstalkd' => [
45
+            'driver' => 'beanstalkd',
46
+            'host' => 'localhost',
47
+            'queue' => 'default',
48
+            'retry_after' => 90,
49
+        ],
50
+
51
+        'sqs' => [
52
+            'driver' => 'sqs',
53
+            'key' => env('SQS_KEY', 'your-public-key'),
54
+            'secret' => env('SQS_SECRET', 'your-secret-key'),
55
+            'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
56
+            'queue' => env('SQS_QUEUE', 'your-queue-name'),
57
+            'region' => env('SQS_REGION', 'us-east-1'),
58
+        ],
59
+
60
+        'redis' => [
61
+            'driver' => 'redis',
62
+            'connection' => 'default',
63
+            'queue' => 'default',
64
+            'retry_after' => 90,
65
+            'block_for' => null,
66
+        ],
67
+
68
+    ],
69
+
70
+    /*
71
+    |--------------------------------------------------------------------------
72
+    | Failed Queue Jobs
73
+    |--------------------------------------------------------------------------
74
+    |
75
+    | These options configure the behavior of failed queue job logging so you
76
+    | can control which database and table are used to store the jobs that
77
+    | have failed. You may change them to any database / table you wish.
78
+    |
79
+    */
80
+
81
+    'failed' => [
82
+        'database' => env('DB_CONNECTION', 'mysql'),
83
+        'table' => 'failed_jobs',
84
+    ],
85
+