51 |
52 | @endsection
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | /*
11 | |--------------------------------------------------------------------------
12 | | Register The Auto Loader
13 | |--------------------------------------------------------------------------
14 | |
15 | | Composer provides a convenient, automatically generated class loader for
16 | | our application. We just need to utilize it! We'll simply require it
17 | | into the script here so that we don't have to worry about manual
18 | | loading any of our classes later on. It feels nice to relax.
19 | |
20 | */
21 |
22 | require __DIR__.'/../bootstrap/autoload.php';
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Turn On The Lights
27 | |--------------------------------------------------------------------------
28 | |
29 | | We need to illuminate PHP development, so let us turn on the lights.
30 | | This bootstraps the framework and gets it ready for use, then it
31 | | will load up this application so that we can run it and send
32 | | the responses back to the browser and delight our users.
33 | |
34 | */
35 |
36 | $app = require_once __DIR__.'/../bootstrap/app.php';
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Run The Application
41 | |--------------------------------------------------------------------------
42 | |
43 | | Once we have the application, we can handle the incoming request
44 | | through the kernel, and send the associated response back to
45 | | the client's browser allowing them to enjoy the creative
46 | | and wonderful application we have prepared for them.
47 | |
48 | */
49 |
50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
51 |
52 | $response = $kernel->handle(
53 | $request = Illuminate\Http\Request::capture()
54 | );
55 |
56 | $response->send();
57 |
58 | $kernel->terminate($request, $response);
59 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/email.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
Reset Password
9 |
10 | @if (session('status'))
11 |
12 | {{ session('status') }}
13 |
14 | @endif
15 |
16 |
41 |
42 |
43 |
44 |
45 |
46 | @endsection
47 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisterController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
40 | }
41 |
42 | /**
43 | * Get a validator for an incoming registration request.
44 | *
45 | * @param array $data
46 | * @return \Illuminate\Contracts\Validation\Validator
47 | */
48 | protected function validator(array $data)
49 | {
50 | return Validator::make($data, [
51 | 'name' => 'required|max:255',
52 | 'email' => 'required|email|max:255|unique:users',
53 | 'password' => 'required|min:6|confirmed',
54 | ]);
55 | }
56 |
57 | /**
58 | * Create a new user instance after a valid registration.
59 | *
60 | * @param array $data
61 | * @return User
62 | */
63 | protected function create(array $data)
64 | {
65 | return User::create([
66 | 'name' => $data['name'],
67 | 'email' => $data['email'],
68 | 'password' => $data['password'],
69 | ]);
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
60 | return response()->json(['error' => 'Unauthenticated.'], 401);
61 | }
62 |
63 | return redirect()->guest(route('login'));
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | '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' => '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", "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_KEY'),
61 | 'secret' => env('AWS_SECRET'),
62 | 'region' => env('AWS_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | ],
65 |
66 | ],
67 |
68 | ];
69 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
30 | \App\Http\Middleware\EncryptCookies::class,
31 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
32 | \Illuminate\Session\Middleware\StartSession::class,
33 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
34 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
35 | \App\Http\Middleware\VerifyCsrfToken::class,
36 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
37 | ],
38 |
39 | 'api' => [
40 | 'throttle:60,1',
41 | 'bindings',
42 | ],
43 | ];
44 |
45 | /**
46 | * The application's route middleware.
47 | *
48 | * These middleware may be assigned to groups or used individually.
49 | *
50 | * @var array
51 | */
52 | protected $routeMiddleware = [
53 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
54 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
55 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
56 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
57 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
58 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
59 | 'isAdmin' => \App\Http\Middleware\AdminMiddleware::class,
60 | 'clearance' => \App\Http\Middleware\ClearanceMiddleware::class,
61 | ];
62 | }
63 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_DRIVER', 'sync'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
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' => 'your-public-key',
54 | 'secret' => 'your-secret-key',
55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
56 | 'queue' => 'your-queue-name',
57 | 'region' => 'us-east-1',
58 | ],
59 |
60 | 'redis' => [
61 | 'driver' => 'redis',
62 | 'connection' => 'default',
63 | 'queue' => 'default',
64 | 'retry_after' => 90,
65 | ],
66 |
67 | ],
68 |
69 | /*
70 | |--------------------------------------------------------------------------
71 | | Failed Queue Jobs
72 | |--------------------------------------------------------------------------
73 | |
74 | | These options configure the behavior of failed queue job logging so you
75 | | can control which database and table are used to store the jobs that
76 | | have failed. You may change them to any database / table you wish.
77 | |
78 | */
79 |
80 | 'failed' => [
81 | 'database' => env('DB_CONNECTION', 'mysql'),
82 | 'table' => 'failed_jobs',
83 | ],
84 |
85 | ];
86 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | */
30 |
31 | 'stores' => [
32 |
33 | 'apc' => [
34 | 'driver' => 'apc',
35 | ],
36 |
37 | 'array' => [
38 | 'driver' => 'array',
39 | ],
40 |
41 | 'database' => [
42 | 'driver' => 'database',
43 | 'table' => 'cache',
44 | 'connection' => null,
45 | ],
46 |
47 | 'file' => [
48 | 'driver' => 'file',
49 | 'path' => storage_path('framework/cache/data'),
50 | ],
51 |
52 | 'memcached' => [
53 | 'driver' => 'memcached',
54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
55 | 'sasl' => [
56 | env('MEMCACHED_USERNAME'),
57 | env('MEMCACHED_PASSWORD'),
58 | ],
59 | 'options' => [
60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
61 | ],
62 | 'servers' => [
63 | [
64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
65 | 'port' => env('MEMCACHED_PORT', 11211),
66 | 'weight' => 100,
67 | ],
68 | ],
69 | ],
70 |
71 | 'redis' => [
72 | 'driver' => 'redis',
73 | 'connection' => 'default',
74 | ],
75 |
76 | ],
77 |
78 | /*
79 | |--------------------------------------------------------------------------
80 | | Cache Key Prefix
81 | |--------------------------------------------------------------------------
82 | |
83 | | When utilizing a RAM based store such as APC or Memcached, there might
84 | | be other applications utilizing the same cache. So, we'll specify a
85 | | value to get prefixed to all our keys so we can avoid collisions.
86 | |
87 | */
88 |
89 | 'prefix' => 'laravel',
90 |
91 | ];
92 |
--------------------------------------------------------------------------------
/resources/views/welcome.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Laravel
9 |
10 |
11 |
12 |
13 |
14 |
66 |
67 |
68 |
68 | @endsection
69 |
--------------------------------------------------------------------------------
/database/migrations/2017_02_20_233057_create_permission_tables.php:
--------------------------------------------------------------------------------
1 | increments('id');
19 | $table->string('name')->unique();
20 | $table->timestamps();
21 | });
22 |
23 | Schema::create($config['permissions'], function (Blueprint $table) {
24 | $table->increments('id');
25 | $table->string('name')->unique();
26 | $table->timestamps();
27 | });
28 |
29 | Schema::create($config['user_has_permissions'], function (Blueprint $table) use ($config) {
30 | $table->integer('user_id')->unsigned();
31 | $table->integer('permission_id')->unsigned();
32 |
33 | $table->foreign('user_id')
34 | ->references('id')
35 | ->on($config['users'])
36 | ->onDelete('cascade');
37 |
38 | $table->foreign('permission_id')
39 | ->references('id')
40 | ->on($config['permissions'])
41 | ->onDelete('cascade');
42 |
43 | $table->primary(['user_id', 'permission_id']);
44 | });
45 |
46 | Schema::create($config['user_has_roles'], function (Blueprint $table) use ($config) {
47 | $table->integer('role_id')->unsigned();
48 | $table->integer('user_id')->unsigned();
49 |
50 | $table->foreign('role_id')
51 | ->references('id')
52 | ->on($config['roles'])
53 | ->onDelete('cascade');
54 |
55 | $table->foreign('user_id')
56 | ->references('id')
57 | ->on($config['users'])
58 | ->onDelete('cascade');
59 |
60 | $table->primary(['role_id', 'user_id']);
61 | });
62 |
63 | Schema::create($config['role_has_permissions'], function (Blueprint $table) use ($config) {
64 | $table->integer('permission_id')->unsigned();
65 | $table->integer('role_id')->unsigned();
66 |
67 | $table->foreign('permission_id')
68 | ->references('id')
69 | ->on($config['permissions'])
70 | ->onDelete('cascade');
71 |
72 | $table->foreign('role_id')
73 | ->references('id')
74 | ->on($config['roles'])
75 | ->onDelete('cascade');
76 |
77 | $table->primary(['permission_id', 'role_id']);
78 | });
79 | }
80 |
81 | /**
82 | * Reverse the migrations.
83 | *
84 | * @return void
85 | */
86 | public function down()
87 | {
88 | $config = config('laravel-permission.table_names');
89 |
90 | Schema::drop($config['role_has_permissions']);
91 | Schema::drop($config['user_has_roles']);
92 | Schema::drop($config['user_has_permissions']);
93 | Schema::drop($config['roles']);
94 | Schema::drop($config['permissions']);
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/config/laravel-permission.php:
--------------------------------------------------------------------------------
1 | [
6 |
7 | /*
8 | * When using the "HasRoles" trait from this package, we need to know which
9 | * Eloquent model should be used to retrieve your permissions. Of course, it
10 | * is often just the "Permission" model but you may use whatever you like.
11 | *
12 | * The model you want to use as a Permission model needs to implement the
13 | * `Spatie\Permission\Contracts\Permission` contract.
14 | */
15 |
16 | 'permission' => Spatie\Permission\Models\Permission::class,
17 |
18 | /*
19 | * When using the "HasRoles" trait from this package, we need to know which
20 | * Eloquent model should be used to retrieve your roles. Of course, it
21 | * is often just the "Role" model but you may use whatever you like.
22 | *
23 | * The model you want to use as a Role model needs to implement the
24 | * `Spatie\Permission\Contracts\Role` contract.
25 | */
26 |
27 | 'role' => Spatie\Permission\Models\Role::class,
28 |
29 | ],
30 |
31 | 'table_names' => [
32 |
33 | /*
34 | * The table that your application uses for users. This table's model will
35 | * be using the "HasRoles" and "HasPermissions" traits.
36 | */
37 |
38 | 'users' => 'users',
39 |
40 | /*
41 | * When using the "HasRoles" trait from this package, we need to know which
42 | * table should be used to retrieve your roles. We have chosen a basic
43 | * default value but you may easily change it to any table you like.
44 | */
45 |
46 | 'roles' => 'roles',
47 |
48 | /*
49 | * When using the "HasRoles" trait from this package, we need to know which
50 | * table should be used to retrieve your permissions. We have chosen a basic
51 | * default value but you may easily change it to any table you like.
52 | */
53 |
54 | 'permissions' => 'permissions',
55 |
56 | /*
57 | * When using the "HasRoles" trait from this package, we need to know which
58 | * table should be used to retrieve your users permissions. We have chosen a
59 | * basic default value but you may easily change it to any table you like.
60 | */
61 |
62 | 'user_has_permissions' => 'user_has_permissions',
63 |
64 | /*
65 | * When using the "HasRoles" trait from this package, we need to know which
66 | * table should be used to retrieve your users roles. We have chosen a
67 | * basic default value but you may easily change it to any table you like.
68 | */
69 |
70 | 'user_has_roles' => 'user_has_roles',
71 |
72 | /*
73 | * When using the "HasRoles" trait from this package, we need to know which
74 | * table should be used to retrieve your roles permissions. We have chosen a
75 | * basic default value but you may easily change it to any table you like.
76 | */
77 |
78 | 'role_has_permissions' => 'role_has_permissions',
79 |
80 | ],
81 |
82 | /*
83 | *
84 | * By default we'll make an entry in the application log when the permissions
85 | * could not be loaded. Normally this only occurs while installing the packages.
86 | *
87 | * If for some reason you want to disable that logging, set this value to false.
88 | */
89 |
90 | 'log_registration_exception' => true,
91 | ];
92 |
--------------------------------------------------------------------------------
/app/Http/Controllers/PostController.php:
--------------------------------------------------------------------------------
1 | middleware(['auth', 'clearance'])
17 | ->except('index', 'show');
18 | }
19 |
20 | /**
21 | * Display a listing of the resource.
22 | *
23 | * @return \Illuminate\Http\Response
24 | */
25 |
26 |
27 | public function index()
28 | {
29 | $posts = Post::orderby('id', 'desc')->paginate(5);
30 | return view('posts.index', compact('posts'));
31 | }
32 |
33 | /**
34 | * Show the form for creating a new resource.
35 | *
36 | * @return \Illuminate\Http\Response
37 | */
38 | public function create()
39 | {
40 | return view('posts.create');
41 | }
42 |
43 | /**
44 | * Store a newly created resource in storage.
45 | *
46 | * @param \Illuminate\Http\Request $request
47 | * @return \Illuminate\Http\Response
48 | */
49 | public function store(Request $request)
50 | {
51 | $this->validate($request, [
52 | 'title'=>'required|max:100',
53 | 'body' =>'required',
54 | ]);
55 |
56 | $title = $request['title'];
57 | $body = $request['body'];
58 |
59 | $post = Post::create($request->only('title', 'body'));
60 |
61 | return redirect()->route('posts.index')
62 | ->with('flash_message', 'Article,
63 | '. $post->title.' created');
64 | }
65 |
66 | /**
67 | * Display the specified resource.
68 | *
69 | * @param int $id
70 | * @return \Illuminate\Http\Response
71 | */
72 | public function show($id)
73 | {
74 | $post = Post::findOrFail($id);
75 |
76 | return view ('posts.show', compact('post'));
77 | }
78 |
79 | /**
80 | * Show the form for editing the specified resource.
81 | *
82 | * @param int $id
83 | * @return \Illuminate\Http\Response
84 | */
85 | public function edit($id)
86 | {
87 | $post = Post::findOrFail($id);
88 |
89 | return view('posts.edit', compact('post'));
90 | }
91 |
92 | /**
93 | * Update the specified resource in storage.
94 | *
95 | * @param \Illuminate\Http\Request $request
96 | * @param int $id
97 | * @return \Illuminate\Http\Response
98 | */
99 | public function update(Request $request, $id)
100 | {
101 | $this->validate($request, [
102 | 'title'=>'required|max:100',
103 | 'body'=>'required',
104 | ]);
105 |
106 | $post = Post::findOrFail($id);
107 | $post->title = $request->input('title');
108 | $post->body = $request->input('body');
109 | $post->save();
110 |
111 | return redirect()->route('posts.show',
112 | $post->id)->with('flash_message',
113 | 'Article, '. $post->title.' updated');
114 | }
115 |
116 | /**
117 | * Remove the specified resource from storage.
118 | *
119 | * @param int $id
120 | * @return \Illuminate\Http\Response
121 | */
122 | public function destroy($id)
123 | {
124 | $post = Post::findOrFail($id);
125 | $post->delete();
126 |
127 | return redirect()->route('posts.index')
128 | ->with('flash_message',
129 | 'Article successfully deleted');
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
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' => 'session',
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 | ];
103 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/reset.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/resources/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | 'The :attribute must be accepted.',
17 | 'active_url' => 'The :attribute is not a valid URL.',
18 | 'after' => 'The :attribute must be a date after :date.',
19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
20 | 'alpha' => 'The :attribute may only contain letters.',
21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.',
23 | 'array' => 'The :attribute must be an array.',
24 | 'before' => 'The :attribute must be a date before :date.',
25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
26 | 'between' => [
27 | 'numeric' => 'The :attribute must be between :min and :max.',
28 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
29 | 'string' => 'The :attribute must be between :min and :max characters.',
30 | 'array' => 'The :attribute must have between :min and :max items.',
31 | ],
32 | 'boolean' => 'The :attribute field must be true or false.',
33 | 'confirmed' => 'The :attribute confirmation does not match.',
34 | 'date' => 'The :attribute is not a valid date.',
35 | 'date_format' => 'The :attribute does not match the format :format.',
36 | 'different' => 'The :attribute and :other must be different.',
37 | 'digits' => 'The :attribute must be :digits digits.',
38 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
39 | 'dimensions' => 'The :attribute has invalid image dimensions.',
40 | 'distinct' => 'The :attribute field has a duplicate value.',
41 | 'email' => 'The :attribute must be a valid email address.',
42 | 'exists' => 'The selected :attribute is invalid.',
43 | 'file' => 'The :attribute must be a file.',
44 | 'filled' => 'The :attribute field is required.',
45 | 'image' => 'The :attribute must be an image.',
46 | 'in' => 'The selected :attribute is invalid.',
47 | 'in_array' => 'The :attribute field does not exist in :other.',
48 | 'integer' => 'The :attribute must be an integer.',
49 | 'ip' => 'The :attribute must be a valid IP address.',
50 | 'json' => 'The :attribute must be a valid JSON string.',
51 | 'max' => [
52 | 'numeric' => 'The :attribute may not be greater than :max.',
53 | 'file' => 'The :attribute may not be greater than :max kilobytes.',
54 | 'string' => 'The :attribute may not be greater than :max characters.',
55 | 'array' => 'The :attribute may not have more than :max items.',
56 | ],
57 | 'mimes' => 'The :attribute must be a file of type: :values.',
58 | 'mimetypes' => 'The :attribute must be a file of type: :values.',
59 | 'min' => [
60 | 'numeric' => 'The :attribute must be at least :min.',
61 | 'file' => 'The :attribute must be at least :min kilobytes.',
62 | 'string' => 'The :attribute must be at least :min characters.',
63 | 'array' => 'The :attribute must have at least :min items.',
64 | ],
65 | 'not_in' => 'The selected :attribute is invalid.',
66 | 'numeric' => 'The :attribute must be a number.',
67 | 'present' => 'The :attribute field must be present.',
68 | 'regex' => 'The :attribute format is invalid.',
69 | 'required' => 'The :attribute field is required.',
70 | 'required_if' => 'The :attribute field is required when :other is :value.',
71 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
72 | 'required_with' => 'The :attribute field is required when :values is present.',
73 | 'required_with_all' => 'The :attribute field is required when :values is present.',
74 | 'required_without' => 'The :attribute field is required when :values is not present.',
75 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
76 | 'same' => 'The :attribute and :other must match.',
77 | 'size' => [
78 | 'numeric' => 'The :attribute must be :size.',
79 | 'file' => 'The :attribute must be :size kilobytes.',
80 | 'string' => 'The :attribute must be :size characters.',
81 | 'array' => 'The :attribute must contain :size items.',
82 | ],
83 | 'string' => 'The :attribute must be a string.',
84 | 'timezone' => 'The :attribute must be a valid zone.',
85 | 'unique' => 'The :attribute has already been taken.',
86 | 'uploaded' => 'The :attribute failed to upload.',
87 | 'url' => 'The :attribute format is invalid.',
88 |
89 | /*
90 | |--------------------------------------------------------------------------
91 | | Custom Validation Language Lines
92 | |--------------------------------------------------------------------------
93 | |
94 | | Here you may specify custom validation messages for attributes using the
95 | | convention "attribute.rule" to name the lines. This makes it quick to
96 | | specify a specific custom language line for a given attribute rule.
97 | |
98 | */
99 |
100 | 'custom' => [
101 | 'attribute-name' => [
102 | 'rule-name' => 'custom-message',
103 | ],
104 | ],
105 |
106 | /*
107 | |--------------------------------------------------------------------------
108 | | Custom Validation Attributes
109 | |--------------------------------------------------------------------------
110 | |
111 | | The following language lines are used to swap attribute place-holders
112 | | with something more reader friendly such as E-Mail Address instead
113 | | of "email". This simply helps us make messages a little cleaner.
114 | |
115 | */
116 |
117 | 'attributes' => [],
118 |
119 | ];
120 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Session Lifetime
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may specify the number of minutes that you wish the session
27 | | to be allowed to remain idle before it expires. If you want them
28 | | to immediately expire on the browser closing, set that option.
29 | |
30 | */
31 |
32 | 'lifetime' => 120,
33 |
34 | 'expire_on_close' => false,
35 |
36 | /*
37 | |--------------------------------------------------------------------------
38 | | Session Encryption
39 | |--------------------------------------------------------------------------
40 | |
41 | | This option allows you to easily specify that all of your session data
42 | | should be encrypted before it is stored. All encryption will be run
43 | | automatically by Laravel and you can use the Session like normal.
44 | |
45 | */
46 |
47 | 'encrypt' => false,
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Session File Location
52 | |--------------------------------------------------------------------------
53 | |
54 | | When using the native session driver, we need a location where session
55 | | files may be stored. A default has been set for you but a different
56 | | location may be specified. This is only needed for file sessions.
57 | |
58 | */
59 |
60 | 'files' => storage_path('framework/sessions'),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Session Database Connection
65 | |--------------------------------------------------------------------------
66 | |
67 | | When using the "database" or "redis" session drivers, you may specify a
68 | | connection that should be used to manage these sessions. This should
69 | | correspond to a connection in your database configuration options.
70 | |
71 | */
72 |
73 | 'connection' => null,
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Session Database Table
78 | |--------------------------------------------------------------------------
79 | |
80 | | When using the "database" session driver, you may specify the table we
81 | | should use to manage the sessions. Of course, a sensible default is
82 | | provided for you; however, you are free to change this as needed.
83 | |
84 | */
85 |
86 | 'table' => 'sessions',
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Session Cache Store
91 | |--------------------------------------------------------------------------
92 | |
93 | | When using the "apc" or "memcached" session drivers, you may specify a
94 | | cache store that should be used for these sessions. This value must
95 | | correspond with one of the application's configured cache stores.
96 | |
97 | */
98 |
99 | 'store' => null,
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Session Sweeping Lottery
104 | |--------------------------------------------------------------------------
105 | |
106 | | Some session drivers must manually sweep their storage location to get
107 | | rid of old sessions from storage. Here are the chances that it will
108 | | happen on a given request. By default, the odds are 2 out of 100.
109 | |
110 | */
111 |
112 | 'lottery' => [2, 100],
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Session Cookie Name
117 | |--------------------------------------------------------------------------
118 | |
119 | | Here you may change the name of the cookie used to identify a session
120 | | instance by ID. The name specified here will get used every time a
121 | | new session cookie is created by the framework for every driver.
122 | |
123 | */
124 |
125 | 'cookie' => 'laravel_session',
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | Session Cookie Path
130 | |--------------------------------------------------------------------------
131 | |
132 | | The session cookie path determines the path for which the cookie will
133 | | be regarded as available. Typically, this will be the root path of
134 | | your application but you are free to change this when necessary.
135 | |
136 | */
137 |
138 | 'path' => '/',
139 |
140 | /*
141 | |--------------------------------------------------------------------------
142 | | Session Cookie Domain
143 | |--------------------------------------------------------------------------
144 | |
145 | | Here you may change the domain of the cookie used to identify a session
146 | | in your application. This will determine which domains the cookie is
147 | | available to in your application. A sensible default has been set.
148 | |
149 | */
150 |
151 | 'domain' => env('SESSION_DOMAIN', null),
152 |
153 | /*
154 | |--------------------------------------------------------------------------
155 | | HTTPS Only Cookies
156 | |--------------------------------------------------------------------------
157 | |
158 | | By setting this option to true, session cookies will only be sent back
159 | | to the server if the browser has a HTTPS connection. This will keep
160 | | the cookie from being sent to you if it can not be done securely.
161 | |
162 | */
163 |
164 | 'secure' => env('SESSION_SECURE_COOKIE', false),
165 |
166 | /*
167 | |--------------------------------------------------------------------------
168 | | HTTP Access Only
169 | |--------------------------------------------------------------------------
170 | |
171 | | Setting this value to true will prevent JavaScript from accessing the
172 | | value of the cookie and the cookie will only be accessible through
173 | | the HTTP protocol. You are free to modify this option if needed.
174 | |
175 | */
176 |
177 | 'http_only' => true,
178 |
179 | ];
180 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | 'Laravel',
16 |
17 | /*
18 | |--------------------------------------------------------------------------
19 | | Application Environment
20 | |--------------------------------------------------------------------------
21 | |
22 | | This value determines the "environment" your application is currently
23 | | running in. This may determine how you prefer to configure various
24 | | services your application utilizes. Set this in your ".env" file.
25 | |
26 | */
27 |
28 | 'env' => env('APP_ENV', 'production'),
29 |
30 | /*
31 | |--------------------------------------------------------------------------
32 | | Application Debug Mode
33 | |--------------------------------------------------------------------------
34 | |
35 | | When your application is in debug mode, detailed error messages with
36 | | stack traces will be shown on every error that occurs within your
37 | | application. If disabled, a simple generic error page is shown.
38 | |
39 | */
40 |
41 | 'debug' => env('APP_DEBUG', false),
42 |
43 | /*
44 | |--------------------------------------------------------------------------
45 | | Application URL
46 | |--------------------------------------------------------------------------
47 | |
48 | | This URL is used by the console to properly generate URLs when using
49 | | the Artisan command line tool. You should set this to the root of
50 | | your application so that it is used when running Artisan tasks.
51 | |
52 | */
53 |
54 | 'url' => env('APP_URL', 'http://localhost'),
55 |
56 | /*
57 | |--------------------------------------------------------------------------
58 | | Application Timezone
59 | |--------------------------------------------------------------------------
60 | |
61 | | Here you may specify the default timezone for your application, which
62 | | will be used by the PHP date and date-time functions. We have gone
63 | | ahead and set this to a sensible default for you out of the box.
64 | |
65 | */
66 |
67 | 'timezone' => 'UTC',
68 |
69 | /*
70 | |--------------------------------------------------------------------------
71 | | Application Locale Configuration
72 | |--------------------------------------------------------------------------
73 | |
74 | | The application locale determines the default locale that will be used
75 | | by the translation service provider. You are free to set this value
76 | | to any of the locales which will be supported by the application.
77 | |
78 | */
79 |
80 | 'locale' => 'en',
81 |
82 | /*
83 | |--------------------------------------------------------------------------
84 | | Application Fallback Locale
85 | |--------------------------------------------------------------------------
86 | |
87 | | The fallback locale determines the locale to use when the current one
88 | | is not available. You may change the value to correspond to any of
89 | | the language folders that are provided through your application.
90 | |
91 | */
92 |
93 | 'fallback_locale' => 'en',
94 |
95 | /*
96 | |--------------------------------------------------------------------------
97 | | Encryption Key
98 | |--------------------------------------------------------------------------
99 | |
100 | | This key is used by the Illuminate encrypter service and should be set
101 | | to a random, 32 character string, otherwise these encrypted strings
102 | | will not be safe. Please do this before deploying an application!
103 | |
104 | */
105 |
106 | 'key' => env('APP_KEY'),
107 |
108 | 'cipher' => 'AES-256-CBC',
109 |
110 | /*
111 | |--------------------------------------------------------------------------
112 | | Logging Configuration
113 | |--------------------------------------------------------------------------
114 | |
115 | | Here you may configure the log settings for your application. Out of
116 | | the box, Laravel uses the Monolog PHP logging library. This gives
117 | | you a variety of powerful log handlers / formatters to utilize.
118 | |
119 | | Available Settings: "single", "daily", "syslog", "errorlog"
120 | |
121 | */
122 |
123 | 'log' => env('APP_LOG', 'single'),
124 |
125 | 'log_level' => env('APP_LOG_LEVEL', 'debug'),
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | Autoloaded Service Providers
130 | |--------------------------------------------------------------------------
131 | |
132 | | The service providers listed here will be automatically loaded on the
133 | | request to your application. Feel free to add your own services to
134 | | this array to grant expanded functionality to your applications.
135 | |
136 | */
137 |
138 | 'providers' => [
139 |
140 | /*
141 | * Laravel Framework Service Providers...
142 | */
143 | Illuminate\Auth\AuthServiceProvider::class,
144 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
145 | Illuminate\Bus\BusServiceProvider::class,
146 | Illuminate\Cache\CacheServiceProvider::class,
147 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
148 | Illuminate\Cookie\CookieServiceProvider::class,
149 | Illuminate\Database\DatabaseServiceProvider::class,
150 | Illuminate\Encryption\EncryptionServiceProvider::class,
151 | Illuminate\Filesystem\FilesystemServiceProvider::class,
152 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
153 | Illuminate\Hashing\HashServiceProvider::class,
154 | Illuminate\Mail\MailServiceProvider::class,
155 | Illuminate\Notifications\NotificationServiceProvider::class,
156 | Illuminate\Pagination\PaginationServiceProvider::class,
157 | Illuminate\Pipeline\PipelineServiceProvider::class,
158 | Illuminate\Queue\QueueServiceProvider::class,
159 | Illuminate\Redis\RedisServiceProvider::class,
160 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
161 | Illuminate\Session\SessionServiceProvider::class,
162 | Illuminate\Translation\TranslationServiceProvider::class,
163 | Illuminate\Validation\ValidationServiceProvider::class,
164 | Illuminate\View\ViewServiceProvider::class,
165 |
166 | /*
167 | * Package Service Providers...
168 | */
169 | Laravel\Tinker\TinkerServiceProvider::class,
170 |
171 | /*
172 | * Application Service Providers...
173 | */
174 | App\Providers\AppServiceProvider::class,
175 | App\Providers\AuthServiceProvider::class,
176 | // App\Providers\BroadcastServiceProvider::class,
177 | App\Providers\EventServiceProvider::class,
178 | App\Providers\RouteServiceProvider::class,
179 |
180 | Spatie\Permission\PermissionServiceProvider::class,
181 |
182 | Collective\Html\HtmlServiceProvider::class,
183 |
184 | ],
185 |
186 | /*
187 | |--------------------------------------------------------------------------
188 | | Class Aliases
189 | |--------------------------------------------------------------------------
190 | |
191 | | This array of class aliases will be registered when this application
192 | | is started. However, feel free to register as many as you wish as
193 | | the aliases are "lazy" loaded so they don't hinder performance.
194 | |
195 | */
196 |
197 | 'aliases' => [
198 |
199 | 'App' => Illuminate\Support\Facades\App::class,
200 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
201 | 'Auth' => Illuminate\Support\Facades\Auth::class,
202 | 'Blade' => Illuminate\Support\Facades\Blade::class,
203 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
204 | 'Bus' => Illuminate\Support\Facades\Bus::class,
205 | 'Cache' => Illuminate\Support\Facades\Cache::class,
206 | 'Config' => Illuminate\Support\Facades\Config::class,
207 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
208 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
209 | 'DB' => Illuminate\Support\Facades\DB::class,
210 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
211 | 'Event' => Illuminate\Support\Facades\Event::class,
212 | 'File' => Illuminate\Support\Facades\File::class,
213 | 'Gate' => Illuminate\Support\Facades\Gate::class,
214 | 'Hash' => Illuminate\Support\Facades\Hash::class,
215 | 'Lang' => Illuminate\Support\Facades\Lang::class,
216 | 'Log' => Illuminate\Support\Facades\Log::class,
217 | 'Mail' => Illuminate\Support\Facades\Mail::class,
218 | 'Notification' => Illuminate\Support\Facades\Notification::class,
219 | 'Password' => Illuminate\Support\Facades\Password::class,
220 | 'Queue' => Illuminate\Support\Facades\Queue::class,
221 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
222 | 'Redis' => Illuminate\Support\Facades\Redis::class,
223 | 'Request' => Illuminate\Support\Facades\Request::class,
224 | 'Response' => Illuminate\Support\Facades\Response::class,
225 | 'Route' => Illuminate\Support\Facades\Route::class,
226 | 'Schema' => Illuminate\Support\Facades\Schema::class,
227 | 'Session' => Illuminate\Support\Facades\Session::class,
228 | 'Storage' => Illuminate\Support\Facades\Storage::class,
229 | 'URL' => Illuminate\Support\Facades\URL::class,
230 | 'Validator' => Illuminate\Support\Facades\Validator::class,
231 | 'View' => Illuminate\Support\Facades\View::class,
232 | 'Form' => Collective\Html\FormFacade::class,
233 | 'Html' => Collective\Html\HtmlFacade::class,
234 |
235 | ],
236 |
237 | ];
238 |
--------------------------------------------------------------------------------