13 | {{ __('A fresh verification link has been sent to your email address.') }}
14 |
15 | @endif
16 |
17 | {{ __('Before proceeding, please check your email for a verification link.') }}
18 | {{ __('If you did not receive the email') }},
19 |
23 |
60 | @endsection
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | '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' => 65536,
48 | 'threads' => 1,
49 | 'time' => 4,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | 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;
56 |
--------------------------------------------------------------------------------
/resources/views/products/create.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 |
4 | @section('content')
5 |
77 | @endsection
78 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'smtp'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Mailer Configurations
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure all of the mailers used by your application plus
24 | | their respective settings. Several examples have been configured for
25 | | you and you are free to add your own as your application requires.
26 | |
27 | | Laravel supports a variety of mail "transport" drivers to be used while
28 | | sending an e-mail. You will specify which one you are using for your
29 | | mailers below. You are free to add additional mailers as required.
30 | |
31 | | Supported: "smtp", "sendmail", "mailgun", "ses",
32 | | "postmark", "log", "array", "failover"
33 | |
34 | */
35 |
36 | 'mailers' => [
37 | 'smtp' => [
38 | 'transport' => 'smtp',
39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
40 | 'port' => env('MAIL_PORT', 587),
41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
42 | 'username' => env('MAIL_USERNAME'),
43 | 'password' => env('MAIL_PASSWORD'),
44 | 'timeout' => null,
45 | ],
46 |
47 | 'ses' => [
48 | 'transport' => 'ses',
49 | ],
50 |
51 | 'mailgun' => [
52 | 'transport' => 'mailgun',
53 | ],
54 |
55 | 'postmark' => [
56 | 'transport' => 'postmark',
57 | ],
58 |
59 | 'sendmail' => [
60 | 'transport' => 'sendmail',
61 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
62 | ],
63 |
64 | 'log' => [
65 | 'transport' => 'log',
66 | 'channel' => env('MAIL_LOG_CHANNEL'),
67 | ],
68 |
69 | 'array' => [
70 | 'transport' => 'array',
71 | ],
72 |
73 | 'failover' => [
74 | 'transport' => 'failover',
75 | 'mailers' => [
76 | 'smtp',
77 | 'log',
78 | ],
79 | ],
80 | ],
81 |
82 | /*
83 | |--------------------------------------------------------------------------
84 | | Global "From" Address
85 | |--------------------------------------------------------------------------
86 | |
87 | | You may wish for all e-mails sent by your application to be sent from
88 | | the same address. Here, you may specify a name and address that is
89 | | used globally for all e-mails that are sent by your application.
90 | |
91 | */
92 |
93 | 'from' => [
94 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
95 | 'name' => env('MAIL_FROM_NAME', 'Example'),
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Markdown Mail Settings
101 | |--------------------------------------------------------------------------
102 | |
103 | | If you are using Markdown based email rendering, you may configure your
104 | | theme and component paths here, allowing you to customize the design
105 | | of the emails. Or, you may simply stick with the Laravel defaults!
106 | |
107 | */
108 |
109 | 'markdown' => [
110 | 'theme' => 'default',
111 |
112 | 'paths' => [
113 | resource_path('views/vendor/mail'),
114 | ],
115 | ],
116 |
117 | ];
118 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## About Laravel
11 |
12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13 |
14 | - [Simple, fast routing engine](https://laravel.com/docs/routing).
15 | - [Powerful dependency injection container](https://laravel.com/docs/container).
16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19 | - [Robust background job processing](https://laravel.com/docs/queues).
20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21 |
22 | Laravel is accessible, powerful, and provides tools required for large, robust applications.
23 |
24 | ## Learning Laravel
25 |
26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27 |
28 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
29 |
30 | ## Laravel Sponsors
31 |
32 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
33 |
34 | ### Premium Partners
35 |
36 | - **[Vehikl](https://vehikl.com/)**
37 | - **[Tighten Co.](https://tighten.co)**
38 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
39 | - **[64 Robots](https://64robots.com)**
40 | - **[Cubet Techno Labs](https://cubettech.com)**
41 | - **[Cyber-Duck](https://cyber-duck.co.uk)**
42 | - **[Many](https://www.many.co.uk)**
43 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
44 | - **[DevSquad](https://devsquad.com)**
45 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
46 | - **[OP.GG](https://op.gg)**
47 | - **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
48 | - **[Lendio](https://lendio.com)**
49 |
50 | ## Contributing
51 |
52 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
53 |
54 | ## Code of Conduct
55 |
56 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
57 |
58 | ## Security Vulnerabilities
59 |
60 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
61 |
62 | ## License
63 |
64 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
65 |
--------------------------------------------------------------------------------
/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"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 | ],
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | User Providers
48 | |--------------------------------------------------------------------------
49 | |
50 | | All authentication drivers have a user provider. This defines how the
51 | | users are actually retrieved out of your database or other storage
52 | | mechanisms used by this application to persist your user's data.
53 | |
54 | | If you have multiple user tables or models you may configure multiple
55 | | sources which represent each model / table. These sources may then
56 | | be assigned to any extra authentication guards you have defined.
57 | |
58 | | Supported: "database", "eloquent"
59 | |
60 | */
61 |
62 | 'providers' => [
63 | 'users' => [
64 | 'driver' => 'eloquent',
65 | 'model' => App\Models\User::class,
66 | ],
67 |
68 | // 'users' => [
69 | // 'driver' => 'database',
70 | // 'table' => 'users',
71 | // ],
72 | ],
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Resetting Passwords
77 | |--------------------------------------------------------------------------
78 | |
79 | | You may specify multiple password reset configurations if you have more
80 | | than one user table or model in the application and you want to have
81 | | separate password reset settings based on the specific user types.
82 | |
83 | | The expire time is the number of minutes that each reset token will be
84 | | considered valid. This security feature keeps tokens short-lived so
85 | | they have less time to be guessed. You may change this as needed.
86 | |
87 | */
88 |
89 | 'passwords' => [
90 | 'users' => [
91 | 'provider' => 'users',
92 | 'table' => 'password_resets',
93 | 'expire' => 60,
94 | 'throttle' => 60,
95 | ],
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Password Confirmation Timeout
101 | |--------------------------------------------------------------------------
102 | |
103 | | Here you may define the amount of seconds before a password confirmation
104 | | times out and the user is prompted to re-enter their password via the
105 | | confirmation screen. By default, the timeout lasts for three hours.
106 | |
107 | */
108 |
109 | 'password_timeout' => 10800,
110 |
111 | ];
112 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Deprecations Log Channel
25 | |--------------------------------------------------------------------------
26 | |
27 | | This option controls the log channel that should be used to log warnings
28 | | regarding deprecated PHP and library features. This allows you to get
29 | | your application ready for upcoming major versions of dependencies.
30 | |
31 | */
32 |
33 | 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Log Channels
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may configure the log channels for your application. Out of
41 | | the box, Laravel uses the Monolog PHP logging library. This gives
42 | | you a variety of powerful log handlers / formatters to utilize.
43 | |
44 | | Available Drivers: "single", "daily", "slack", "syslog",
45 | | "errorlog", "monolog",
46 | | "custom", "stack"
47 | |
48 | */
49 |
50 | 'channels' => [
51 | 'stack' => [
52 | 'driver' => 'stack',
53 | 'channels' => ['single'],
54 | 'ignore_exceptions' => false,
55 | ],
56 |
57 | 'single' => [
58 | 'driver' => 'single',
59 | 'path' => storage_path('logs/laravel.log'),
60 | 'level' => env('LOG_LEVEL', 'debug'),
61 | ],
62 |
63 | 'daily' => [
64 | 'driver' => 'daily',
65 | 'path' => storage_path('logs/laravel.log'),
66 | 'level' => env('LOG_LEVEL', 'debug'),
67 | 'days' => 14,
68 | ],
69 |
70 | 'slack' => [
71 | 'driver' => 'slack',
72 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
73 | 'username' => 'Laravel Log',
74 | 'emoji' => ':boom:',
75 | 'level' => env('LOG_LEVEL', 'critical'),
76 | ],
77 |
78 | 'papertrail' => [
79 | 'driver' => 'monolog',
80 | 'level' => env('LOG_LEVEL', 'debug'),
81 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
82 | 'handler_with' => [
83 | 'host' => env('PAPERTRAIL_URL'),
84 | 'port' => env('PAPERTRAIL_PORT'),
85 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
86 | ],
87 | ],
88 |
89 | 'stderr' => [
90 | 'driver' => 'monolog',
91 | 'level' => env('LOG_LEVEL', 'debug'),
92 | 'handler' => StreamHandler::class,
93 | 'formatter' => env('LOG_STDERR_FORMATTER'),
94 | 'with' => [
95 | 'stream' => 'php://stderr',
96 | ],
97 | ],
98 |
99 | 'syslog' => [
100 | 'driver' => 'syslog',
101 | 'level' => env('LOG_LEVEL', 'debug'),
102 | ],
103 |
104 | 'errorlog' => [
105 | 'driver' => 'errorlog',
106 | 'level' => env('LOG_LEVEL', 'debug'),
107 | ],
108 |
109 | 'null' => [
110 | 'driver' => 'monolog',
111 | 'handler' => NullHandler::class,
112 | ],
113 |
114 | 'emergency' => [
115 | 'path' => storage_path('logs/laravel.log'),
116 | ],
117 | ],
118 |
119 | ];
120 |
--------------------------------------------------------------------------------
/resources/views/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{ config('app.name', 'Laravel') }}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
80 |
81 |
82 |
83 | @yield('content')
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/app/Http/Controllers/UserController.php:
--------------------------------------------------------------------------------
1 | paginate(5);
23 | return view('users.index',compact('data'))
24 | ->with('i', ($request->input('page', 1) - 1) * 5);
25 | }
26 |
27 | /**
28 | * Show the form for creating a new resource.
29 | *
30 | * @return \Illuminate\Http\Response
31 | */
32 | public function create()
33 | {
34 | $roles = Role::pluck('name','name')->all();
35 | return view('users.create',compact('roles'));
36 | }
37 |
38 | /**
39 | * Store a newly created resource in storage.
40 | *
41 | * @param \Illuminate\Http\Request $request
42 | * @return \Illuminate\Http\Response
43 | */
44 | public function store(Request $request)
45 | {
46 | $this->validate($request, [
47 | 'name' => 'required',
48 | 'email' => 'required|email|unique:users,email',
49 | 'password' => 'required|same:confirm-password',
50 | 'roles' => 'required'
51 | ]);
52 |
53 | $input = $request->all();
54 | $input['password'] = Hash::make($input['password']);
55 |
56 | $user = User::create($input);
57 | $user->assignRole($request->input('roles'));
58 |
59 | return redirect()->route('users.index')
60 | ->with('success','User created successfully');
61 | }
62 |
63 | /**
64 | * Display the specified resource.
65 | *
66 | * @param int $id
67 | * @return \Illuminate\Http\Response
68 | */
69 | public function show($id)
70 | {
71 | $user = User::find($id);
72 | return view('users.show',compact('user'));
73 | }
74 |
75 | /**
76 | * Show the form for editing the specified resource.
77 | *
78 | * @param int $id
79 | * @return \Illuminate\Http\Response
80 | */
81 | public function edit($id)
82 | {
83 | $user = User::find($id);
84 | $roles = Role::pluck('name','name')->all();
85 | $userRole = $user->roles->pluck('name','name')->all();
86 |
87 | return view('users.edit',compact('user','roles','userRole'));
88 | }
89 |
90 | /**
91 | * Update the specified resource in storage.
92 | *
93 | * @param \Illuminate\Http\Request $request
94 | * @param int $id
95 | * @return \Illuminate\Http\Response
96 | */
97 | public function update(Request $request, $id)
98 | {
99 | $this->validate($request, [
100 | 'name' => 'required',
101 | 'email' => 'required|email|unique:users,email,'.$id,
102 | 'password' => 'same:confirm-password',
103 | 'roles' => 'required'
104 | ]);
105 |
106 | $input = $request->all();
107 | if(!empty($input['password'])){
108 | $input['password'] = Hash::make($input['password']);
109 | }else{
110 | $input = Arr::except($input,array('password'));
111 | }
112 |
113 | $user = User::find($id);
114 | $user->update($input);
115 | DB::table('model_has_roles')->where('model_id',$id)->delete();
116 |
117 | $user->assignRole($request->input('roles'));
118 |
119 | return redirect()->route('users.index')
120 | ->with('success','User updated successfully');
121 | }
122 |
123 | /**
124 | * Remove the specified resource from storage.
125 | *
126 | * @param int $id
127 | * @return \Illuminate\Http\Response
128 | */
129 | public function destroy($id)
130 | {
131 | User::find($id)->delete();
132 | return redirect()->route('users.index')
133 | ->with('success','User deleted successfully');
134 | }
135 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/RoleController.php:
--------------------------------------------------------------------------------
1 | middleware('permission:role-list|role-create|role-edit|role-delete', ['only' => ['index','store']]);
22 | $this->middleware('permission:role-create', ['only' => ['create','store']]);
23 | $this->middleware('permission:role-edit', ['only' => ['edit','update']]);
24 | $this->middleware('permission:role-delete', ['only' => ['destroy']]);
25 | }
26 |
27 | /**
28 | * Display a listing of the resource.
29 | *
30 | * @return \Illuminate\Http\Response
31 | */
32 | public function index(Request $request)
33 | {
34 | $roles = Role::orderBy('id','DESC')->paginate(5);
35 | return view('roles.index',compact('roles'))
36 | ->with('i', ($request->input('page', 1) - 1) * 5);
37 | }
38 |
39 | /**
40 | * Show the form for creating a new resource.
41 | *
42 | * @return \Illuminate\Http\Response
43 | */
44 | public function create()
45 | {
46 | $permission = Permission::get();
47 | return view('roles.create',compact('permission'));
48 | }
49 |
50 | /**
51 | * Store a newly created resource in storage.
52 | *
53 | * @param \Illuminate\Http\Request $request
54 | * @return \Illuminate\Http\Response
55 | */
56 | public function store(Request $request)
57 | {
58 | $this->validate($request, [
59 | 'name' => 'required|unique:roles,name',
60 | 'permission' => 'required',
61 | ]);
62 |
63 | $role = Role::create(['name' => $request->input('name')]);
64 | $role->syncPermissions($request->input('permission'));
65 |
66 | return redirect()->route('roles.index')
67 | ->with('success','Role created successfully');
68 | }
69 | /**
70 | * Display the specified resource.
71 | *
72 | * @param int $id
73 | * @return \Illuminate\Http\Response
74 | */
75 | public function show($id)
76 | {
77 | $role = Role::find($id);
78 | $rolePermissions = Permission::join("role_has_permissions","role_has_permissions.permission_id","=","permissions.id")
79 | ->where("role_has_permissions.role_id",$id)
80 | ->get();
81 |
82 | return view('roles.show',compact('role','rolePermissions'));
83 | }
84 |
85 | /**
86 | * Show the form for editing the specified resource.
87 | *
88 | * @param int $id
89 | * @return \Illuminate\Http\Response
90 | */
91 | public function edit($id)
92 | {
93 | $role = Role::find($id);
94 | $permission = Permission::get();
95 | $rolePermissions = DB::table("role_has_permissions")->where("role_has_permissions.role_id",$id)
96 | ->pluck('role_has_permissions.permission_id','role_has_permissions.permission_id')
97 | ->all();
98 |
99 | return view('roles.edit',compact('role','permission','rolePermissions'));
100 | }
101 |
102 | /**
103 | * Update the specified resource in storage.
104 | *
105 | * @param \Illuminate\Http\Request $request
106 | * @param int $id
107 | * @return \Illuminate\Http\Response
108 | */
109 | public function update(Request $request, $id)
110 | {
111 | $this->validate($request, [
112 | 'name' => 'required',
113 | 'permission' => 'required',
114 | ]);
115 |
116 | $role = Role::find($id);
117 | $role->name = $request->input('name');
118 | $role->save();
119 |
120 | $role->syncPermissions($request->input('permission'));
121 |
122 | return redirect()->route('roles.index')
123 | ->with('success','Role updated successfully');
124 | }
125 | /**
126 | * Remove the specified resource from storage.
127 | *
128 | * @param int $id
129 | * @return \Illuminate\Http\Response
130 | */
131 | public function destroy($id)
132 | {
133 | DB::table("roles")->where('id',$id)->delete();
134 | return redirect()->route('roles.index')
135 | ->with('success','Role deleted successfully');
136 | }
137 | }
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Database Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here are each of the database connections setup for your application.
26 | | Of course, examples of configuring each database platform that is
27 | | supported by Laravel is shown below to make development simple.
28 | |
29 | |
30 | | All database work in Laravel is done through the PHP PDO facilities
31 | | so make sure you have the driver for your particular database of
32 | | choice installed on your machine before you begin development.
33 | |
34 | */
35 |
36 | 'connections' => [
37 |
38 | 'sqlite' => [
39 | 'driver' => 'sqlite',
40 | 'url' => env('DATABASE_URL'),
41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
42 | 'prefix' => '',
43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
44 | ],
45 |
46 | 'mysql' => [
47 | 'driver' => 'mysql',
48 | 'url' => env('DATABASE_URL'),
49 | 'host' => env('DB_HOST', '127.0.0.1'),
50 | 'port' => env('DB_PORT', '3306'),
51 | 'database' => env('DB_DATABASE', 'forge'),
52 | 'username' => env('DB_USERNAME', 'forge'),
53 | 'password' => env('DB_PASSWORD', ''),
54 | 'unix_socket' => env('DB_SOCKET', ''),
55 | 'charset' => 'utf8mb4',
56 | 'collation' => 'utf8mb4_unicode_ci',
57 | 'prefix' => '',
58 | 'prefix_indexes' => true,
59 | 'strict' => true,
60 | 'engine' => null,
61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63 | ]) : [],
64 | ],
65 |
66 | 'pgsql' => [
67 | 'driver' => 'pgsql',
68 | 'url' => env('DATABASE_URL'),
69 | 'host' => env('DB_HOST', '127.0.0.1'),
70 | 'port' => env('DB_PORT', '5432'),
71 | 'database' => env('DB_DATABASE', 'forge'),
72 | 'username' => env('DB_USERNAME', 'forge'),
73 | 'password' => env('DB_PASSWORD', ''),
74 | 'charset' => 'utf8',
75 | 'prefix' => '',
76 | 'prefix_indexes' => true,
77 | 'search_path' => 'public',
78 | 'sslmode' => 'prefer',
79 | ],
80 |
81 | 'sqlsrv' => [
82 | 'driver' => 'sqlsrv',
83 | 'url' => env('DATABASE_URL'),
84 | 'host' => env('DB_HOST', 'localhost'),
85 | 'port' => env('DB_PORT', '1433'),
86 | 'database' => env('DB_DATABASE', 'forge'),
87 | 'username' => env('DB_USERNAME', 'forge'),
88 | 'password' => env('DB_PASSWORD', ''),
89 | 'charset' => 'utf8',
90 | 'prefix' => '',
91 | 'prefix_indexes' => true,
92 | // 'encrypt' => env('DB_ENCRYPT', 'yes'),
93 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
94 | ],
95 |
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Migration Repository Table
101 | |--------------------------------------------------------------------------
102 | |
103 | | This table keeps track of all the migrations that have already run for
104 | | your application. Using this information, we can determine which of
105 | | the migrations on disk haven't actually been run in the database.
106 | |
107 | */
108 |
109 | 'migrations' => 'migrations',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Redis Databases
114 | |--------------------------------------------------------------------------
115 | |
116 | | Redis is an open source, fast, and advanced key-value store that also
117 | | provides a richer body of commands than a typical key-value system
118 | | such as APC or Memcached. Laravel makes it easy to dig right in.
119 | |
120 | */
121 |
122 | 'redis' => [
123 |
124 | 'client' => env('REDIS_CLIENT', 'phpredis'),
125 |
126 | 'options' => [
127 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
128 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
129 | ],
130 |
131 | 'default' => [
132 | 'url' => env('REDIS_URL'),
133 | 'host' => env('REDIS_HOST', '127.0.0.1'),
134 | 'username' => env('REDIS_USERNAME'),
135 | 'password' => env('REDIS_PASSWORD'),
136 | 'port' => env('REDIS_PORT', '6379'),
137 | 'database' => env('REDIS_DB', '0'),
138 | ],
139 |
140 | 'cache' => [
141 | 'url' => env('REDIS_URL'),
142 | 'host' => env('REDIS_HOST', '127.0.0.1'),
143 | 'username' => env('REDIS_USERNAME'),
144 | 'password' => env('REDIS_PASSWORD'),
145 | 'port' => env('REDIS_PORT', '6379'),
146 | 'database' => env('REDIS_CACHE_DB', '1'),
147 | ],
148 |
149 | ],
150 |
151 | ];
152 |
--------------------------------------------------------------------------------
/config/permission.php:
--------------------------------------------------------------------------------
1 | [
6 |
7 | /*
8 | * When using the "HasPermissions" 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 | * When using the "HasRoles" trait from this package, we need to know which
35 | * table should be used to retrieve your roles. We have chosen a basic
36 | * default value but you may easily change it to any table you like.
37 | */
38 |
39 | 'roles' => 'roles',
40 |
41 | /*
42 | * When using the "HasPermissions" trait from this package, we need to know which
43 | * table should be used to retrieve your permissions. We have chosen a basic
44 | * default value but you may easily change it to any table you like.
45 | */
46 |
47 | 'permissions' => 'permissions',
48 |
49 | /*
50 | * When using the "HasPermissions" trait from this package, we need to know which
51 | * table should be used to retrieve your models permissions. We have chosen a
52 | * basic default value but you may easily change it to any table you like.
53 | */
54 |
55 | 'model_has_permissions' => 'model_has_permissions',
56 |
57 | /*
58 | * When using the "HasRoles" trait from this package, we need to know which
59 | * table should be used to retrieve your models roles. We have chosen a
60 | * basic default value but you may easily change it to any table you like.
61 | */
62 |
63 | 'model_has_roles' => 'model_has_roles',
64 |
65 | /*
66 | * When using the "HasRoles" trait from this package, we need to know which
67 | * table should be used to retrieve your roles permissions. We have chosen a
68 | * basic default value but you may easily change it to any table you like.
69 | */
70 |
71 | 'role_has_permissions' => 'role_has_permissions',
72 | ],
73 |
74 | 'column_names' => [
75 | /*
76 | * Change this if you want to name the related pivots other than defaults
77 | */
78 | 'role_pivot_key' => null, //default 'role_id',
79 | 'permission_pivot_key' => null, //default 'permission_id',
80 |
81 | /*
82 | * Change this if you want to name the related model primary key other than
83 | * `model_id`.
84 | *
85 | * For example, this would be nice if your primary keys are all UUIDs. In
86 | * that case, name this `model_uuid`.
87 | */
88 |
89 | 'model_morph_key' => 'model_id',
90 |
91 | /*
92 | * Change this if you want to use the teams feature and your related model's
93 | * foreign key is other than `team_id`.
94 | */
95 |
96 | 'team_foreign_key' => 'team_id',
97 | ],
98 |
99 | /*
100 | * When set to true, the method for checking permissions will be registered on the gate.
101 | * Set this to false, if you want to implement custom logic for checking permissions.
102 | */
103 |
104 | 'register_permission_check_method' => true,
105 |
106 | /*
107 | * When set to true the package implements teams using the 'team_foreign_key'. If you want
108 | * the migrations to register the 'team_foreign_key', you must set this to true
109 | * before doing the migration. If you already did the migration then you must make a new
110 | * migration to also add 'team_foreign_key' to 'roles', 'model_has_roles', and
111 | * 'model_has_permissions'(view the latest version of package's migration file)
112 | */
113 |
114 | 'teams' => false,
115 |
116 | /*
117 | * When set to true, the required permission names are added to the exception
118 | * message. This could be considered an information leak in some contexts, so
119 | * the default setting is false here for optimum safety.
120 | */
121 |
122 | 'display_permission_in_exception' => false,
123 |
124 | /*
125 | * When set to true, the required role names are added to the exception
126 | * message. This could be considered an information leak in some contexts, so
127 | * the default setting is false here for optimum safety.
128 | */
129 |
130 | 'display_role_in_exception' => false,
131 |
132 | /*
133 | * By default wildcard permission lookups are disabled.
134 | */
135 |
136 | 'enable_wildcard_permission' => false,
137 |
138 | 'cache' => [
139 |
140 | /*
141 | * By default all permissions are cached for 24 hours to speed up performance.
142 | * When permissions or roles are updated the cache is flushed automatically.
143 | */
144 |
145 | 'expiration_time' => \DateInterval::createFromDateString('24 hours'),
146 |
147 | /*
148 | * The cache key used to store all permissions.
149 | */
150 |
151 | 'key' => 'spatie.permission.cache',
152 |
153 | /*
154 | * You may optionally indicate a specific cache driver to use for permission and
155 | * role caching using any of the `store` drivers listed in the cache.php config
156 | * file. Using 'default' here means to use the `default` set in cache.php.
157 | */
158 |
159 | 'store' => 'default',
160 | ],
161 | ];
162 |
--------------------------------------------------------------------------------
/database/migrations/2022_04_15_130146_create_permission_tables.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
30 | $table->string('name'); // For MySQL 8.0 use string('name', 125);
31 | $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
32 | $table->timestamps();
33 |
34 | $table->unique(['name', 'guard_name']);
35 | });
36 |
37 | Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
38 | $table->bigIncrements('id');
39 | if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
40 | $table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
41 | $table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
42 | }
43 | $table->string('name'); // For MySQL 8.0 use string('name', 125);
44 | $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
45 | $table->timestamps();
46 | if ($teams || config('permission.testing')) {
47 | $table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
48 | } else {
49 | $table->unique(['name', 'guard_name']);
50 | }
51 | });
52 |
53 | Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
54 | $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
55 |
56 | $table->string('model_type');
57 | $table->unsignedBigInteger($columnNames['model_morph_key']);
58 | $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
59 |
60 | $table->foreign(PermissionRegistrar::$pivotPermission)
61 | ->references('id')
62 | ->on($tableNames['permissions'])
63 | ->onDelete('cascade');
64 | if ($teams) {
65 | $table->unsignedBigInteger($columnNames['team_foreign_key']);
66 | $table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
67 |
68 | $table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
69 | 'model_has_permissions_permission_model_type_primary');
70 | } else {
71 | $table->primary([PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
72 | 'model_has_permissions_permission_model_type_primary');
73 | }
74 |
75 | });
76 |
77 | Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
78 | $table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
79 |
80 | $table->string('model_type');
81 | $table->unsignedBigInteger($columnNames['model_morph_key']);
82 | $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
83 |
84 | $table->foreign(PermissionRegistrar::$pivotRole)
85 | ->references('id')
86 | ->on($tableNames['roles'])
87 | ->onDelete('cascade');
88 | if ($teams) {
89 | $table->unsignedBigInteger($columnNames['team_foreign_key']);
90 | $table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
91 |
92 | $table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
93 | 'model_has_roles_role_model_type_primary');
94 | } else {
95 | $table->primary([PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
96 | 'model_has_roles_role_model_type_primary');
97 | }
98 | });
99 |
100 | Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
101 | $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
102 | $table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
103 |
104 | $table->foreign(PermissionRegistrar::$pivotPermission)
105 | ->references('id')
106 | ->on($tableNames['permissions'])
107 | ->onDelete('cascade');
108 |
109 | $table->foreign(PermissionRegistrar::$pivotRole)
110 | ->references('id')
111 | ->on($tableNames['roles'])
112 | ->onDelete('cascade');
113 |
114 | $table->primary([PermissionRegistrar::$pivotPermission, PermissionRegistrar::$pivotRole], 'role_has_permissions_permission_id_role_id_primary');
115 | });
116 |
117 | app('cache')
118 | ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
119 | ->forget(config('permission.cache.key'));
120 | }
121 |
122 | /**
123 | * Reverse the migrations.
124 | *
125 | * @return void
126 | */
127 | public function down()
128 | {
129 | $tableNames = config('permission.table_names');
130 |
131 | if (empty($tableNames)) {
132 | throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
133 | }
134 |
135 | Schema::drop($tableNames['role_has_permissions']);
136 | Schema::drop($tableNames['model_has_roles']);
137 | Schema::drop($tableNames['model_has_permissions']);
138 | Schema::drop($tableNames['roles']);
139 | Schema::drop($tableNames['permissions']);
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Session Lifetime
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may specify the number of minutes that you wish the session
29 | | to be allowed to remain idle before it expires. If you want them
30 | | to immediately expire on the browser closing, set that option.
31 | |
32 | */
33 |
34 | 'lifetime' => env('SESSION_LIFETIME', 120),
35 |
36 | 'expire_on_close' => false,
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Session Encryption
41 | |--------------------------------------------------------------------------
42 | |
43 | | This option allows you to easily specify that all of your session data
44 | | should be encrypted before it is stored. All encryption will be run
45 | | automatically by Laravel and you can use the Session like normal.
46 | |
47 | */
48 |
49 | 'encrypt' => false,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Session File Location
54 | |--------------------------------------------------------------------------
55 | |
56 | | When using the native session driver, we need a location where session
57 | | files may be stored. A default has been set for you but a different
58 | | location may be specified. This is only needed for file sessions.
59 | |
60 | */
61 |
62 | 'files' => storage_path('framework/sessions'),
63 |
64 | /*
65 | |--------------------------------------------------------------------------
66 | | Session Database Connection
67 | |--------------------------------------------------------------------------
68 | |
69 | | When using the "database" or "redis" session drivers, you may specify a
70 | | connection that should be used to manage these sessions. This should
71 | | correspond to a connection in your database configuration options.
72 | |
73 | */
74 |
75 | 'connection' => env('SESSION_CONNECTION'),
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Session Database Table
80 | |--------------------------------------------------------------------------
81 | |
82 | | When using the "database" session driver, you may specify the table we
83 | | should use to manage the sessions. Of course, a sensible default is
84 | | provided for you; however, you are free to change this as needed.
85 | |
86 | */
87 |
88 | 'table' => 'sessions',
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Session Cache Store
93 | |--------------------------------------------------------------------------
94 | |
95 | | While using one of the framework's cache driven session backends you may
96 | | list a cache store that should be used for these sessions. This value
97 | | must match with one of the application's configured cache "stores".
98 | |
99 | | Affects: "apc", "dynamodb", "memcached", "redis"
100 | |
101 | */
102 |
103 | 'store' => env('SESSION_STORE'),
104 |
105 | /*
106 | |--------------------------------------------------------------------------
107 | | Session Sweeping Lottery
108 | |--------------------------------------------------------------------------
109 | |
110 | | Some session drivers must manually sweep their storage location to get
111 | | rid of old sessions from storage. Here are the chances that it will
112 | | happen on a given request. By default, the odds are 2 out of 100.
113 | |
114 | */
115 |
116 | 'lottery' => [2, 100],
117 |
118 | /*
119 | |--------------------------------------------------------------------------
120 | | Session Cookie Name
121 | |--------------------------------------------------------------------------
122 | |
123 | | Here you may change the name of the cookie used to identify a session
124 | | instance by ID. The name specified here will get used every time a
125 | | new session cookie is created by the framework for every driver.
126 | |
127 | */
128 |
129 | 'cookie' => env(
130 | 'SESSION_COOKIE',
131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
132 | ),
133 |
134 | /*
135 | |--------------------------------------------------------------------------
136 | | Session Cookie Path
137 | |--------------------------------------------------------------------------
138 | |
139 | | The session cookie path determines the path for which the cookie will
140 | | be regarded as available. Typically, this will be the root path of
141 | | your application but you are free to change this when necessary.
142 | |
143 | */
144 |
145 | 'path' => '/',
146 |
147 | /*
148 | |--------------------------------------------------------------------------
149 | | Session Cookie Domain
150 | |--------------------------------------------------------------------------
151 | |
152 | | Here you may change the domain of the cookie used to identify a session
153 | | in your application. This will determine which domains the cookie is
154 | | available to in your application. A sensible default has been set.
155 | |
156 | */
157 |
158 | 'domain' => env('SESSION_DOMAIN'),
159 |
160 | /*
161 | |--------------------------------------------------------------------------
162 | | HTTPS Only Cookies
163 | |--------------------------------------------------------------------------
164 | |
165 | | By setting this option to true, session cookies will only be sent back
166 | | to the server if the browser has a HTTPS connection. This will keep
167 | | the cookie from being sent to you when it can't be done securely.
168 | |
169 | */
170 |
171 | 'secure' => env('SESSION_SECURE_COOKIE'),
172 |
173 | /*
174 | |--------------------------------------------------------------------------
175 | | HTTP Access Only
176 | |--------------------------------------------------------------------------
177 | |
178 | | Setting this value to true will prevent JavaScript from accessing the
179 | | value of the cookie and the cookie will only be accessible through
180 | | the HTTP protocol. You are free to modify this option if needed.
181 | |
182 | */
183 |
184 | 'http_only' => true,
185 |
186 | /*
187 | |--------------------------------------------------------------------------
188 | | Same-Site Cookies
189 | |--------------------------------------------------------------------------
190 | |
191 | | This option determines how your cookies behave when cross-site requests
192 | | take place, and can be used to mitigate CSRF attacks. By default, we
193 | | will set this value to "lax" since this is a secure default value.
194 | |
195 | | Supported: "lax", "strict", "none", null
196 | |
197 | */
198 |
199 | 'same_site' => 'lax',
200 |
201 | ];
202 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Application Environment
23 | |--------------------------------------------------------------------------
24 | |
25 | | This value determines the "environment" your application is currently
26 | | running in. This may determine how you prefer to configure various
27 | | services the application utilizes. Set this in your ".env" file.
28 | |
29 | */
30 |
31 | 'env' => env('APP_ENV', 'production'),
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Application Debug Mode
36 | |--------------------------------------------------------------------------
37 | |
38 | | When your application is in debug mode, detailed error messages with
39 | | stack traces will be shown on every error that occurs within your
40 | | application. If disabled, a simple generic error page is shown.
41 | |
42 | */
43 |
44 | 'debug' => (bool) env('APP_DEBUG', false),
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Application URL
49 | |--------------------------------------------------------------------------
50 | |
51 | | This URL is used by the console to properly generate URLs when using
52 | | the Artisan command line tool. You should set this to the root of
53 | | your application so that it is used when running Artisan tasks.
54 | |
55 | */
56 |
57 | 'url' => env('APP_URL', 'http://localhost'),
58 |
59 | 'asset_url' => env('ASSET_URL'),
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Application Timezone
64 | |--------------------------------------------------------------------------
65 | |
66 | | Here you may specify the default timezone for your application, which
67 | | will be used by the PHP date and date-time functions. We have gone
68 | | ahead and set this to a sensible default for you out of the box.
69 | |
70 | */
71 |
72 | 'timezone' => 'UTC',
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Application Locale Configuration
77 | |--------------------------------------------------------------------------
78 | |
79 | | The application locale determines the default locale that will be used
80 | | by the translation service provider. You are free to set this value
81 | | to any of the locales which will be supported by the application.
82 | |
83 | */
84 |
85 | 'locale' => 'en',
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Application Fallback Locale
90 | |--------------------------------------------------------------------------
91 | |
92 | | The fallback locale determines the locale to use when the current one
93 | | is not available. You may change the value to correspond to any of
94 | | the language folders that are provided through your application.
95 | |
96 | */
97 |
98 | 'fallback_locale' => 'en',
99 |
100 | /*
101 | |--------------------------------------------------------------------------
102 | | Faker Locale
103 | |--------------------------------------------------------------------------
104 | |
105 | | This locale will be used by the Faker PHP library when generating fake
106 | | data for your database seeds. For example, this will be used to get
107 | | localized telephone numbers, street address information and more.
108 | |
109 | */
110 |
111 | 'faker_locale' => 'en_US',
112 |
113 | /*
114 | |--------------------------------------------------------------------------
115 | | Encryption Key
116 | |--------------------------------------------------------------------------
117 | |
118 | | This key is used by the Illuminate encrypter service and should be set
119 | | to a random, 32 character string, otherwise these encrypted strings
120 | | will not be safe. Please do this before deploying an application!
121 | |
122 | */
123 |
124 | 'key' => env('APP_KEY'),
125 |
126 | 'cipher' => 'AES-256-CBC',
127 |
128 | /*
129 | |--------------------------------------------------------------------------
130 | | Autoloaded Service Providers
131 | |--------------------------------------------------------------------------
132 | |
133 | | The service providers listed here will be automatically loaded on the
134 | | request to your application. Feel free to add your own services to
135 | | this array to grant expanded functionality to your applications.
136 | |
137 | */
138 |
139 | 'providers' => [
140 |
141 | /*
142 | * Laravel Framework Service Providers...
143 | */
144 | Illuminate\Auth\AuthServiceProvider::class,
145 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
146 | Illuminate\Bus\BusServiceProvider::class,
147 | Illuminate\Cache\CacheServiceProvider::class,
148 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
149 | Illuminate\Cookie\CookieServiceProvider::class,
150 | Illuminate\Database\DatabaseServiceProvider::class,
151 | Illuminate\Encryption\EncryptionServiceProvider::class,
152 | Illuminate\Filesystem\FilesystemServiceProvider::class,
153 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
154 | Illuminate\Hashing\HashServiceProvider::class,
155 | Illuminate\Mail\MailServiceProvider::class,
156 | Illuminate\Notifications\NotificationServiceProvider::class,
157 | Illuminate\Pagination\PaginationServiceProvider::class,
158 | Illuminate\Pipeline\PipelineServiceProvider::class,
159 | Illuminate\Queue\QueueServiceProvider::class,
160 | Illuminate\Redis\RedisServiceProvider::class,
161 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
162 | Illuminate\Session\SessionServiceProvider::class,
163 | Illuminate\Translation\TranslationServiceProvider::class,
164 | Illuminate\Validation\ValidationServiceProvider::class,
165 | Illuminate\View\ViewServiceProvider::class,
166 |
167 | /*
168 | * Package Service Providers...
169 | */
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 | ],
181 |
182 | /*
183 | |--------------------------------------------------------------------------
184 | | Class Aliases
185 | |--------------------------------------------------------------------------
186 | |
187 | | This array of class aliases will be registered when this application
188 | | is started. However, feel free to register as many as you wish as
189 | | the aliases are "lazy" loaded so they don't hinder performance.
190 | |
191 | */
192 |
193 | 'aliases' => Facade::defaultAliases()->merge([
194 | // 'ExampleClass' => App\Example\ExampleClass::class,
195 | ])->toArray(),
196 |
197 | ];
198 |
--------------------------------------------------------------------------------
/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | 'The :attribute must be accepted.',
17 | 'accepted_if' => 'The :attribute must be accepted when :other is :value.',
18 | 'active_url' => 'The :attribute is not a valid URL.',
19 | 'after' => 'The :attribute must be a date after :date.',
20 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
21 | 'alpha' => 'The :attribute must only contain letters.',
22 | 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
23 | 'alpha_num' => 'The :attribute must only contain letters and numbers.',
24 | 'array' => 'The :attribute must be an array.',
25 | 'before' => 'The :attribute must be a date before :date.',
26 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
27 | 'between' => [
28 | 'array' => 'The :attribute must have between :min and :max items.',
29 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
30 | 'numeric' => 'The :attribute must be between :min and :max.',
31 | 'string' => 'The :attribute must be between :min and :max characters.',
32 | ],
33 | 'boolean' => 'The :attribute field must be true or false.',
34 | 'confirmed' => 'The :attribute confirmation does not match.',
35 | 'current_password' => 'The password is incorrect.',
36 | 'date' => 'The :attribute is not a valid date.',
37 | 'date_equals' => 'The :attribute must be a date equal to :date.',
38 | 'date_format' => 'The :attribute does not match the format :format.',
39 | 'declined' => 'The :attribute must be declined.',
40 | 'declined_if' => 'The :attribute must be declined when :other is :value.',
41 | 'different' => 'The :attribute and :other must be different.',
42 | 'digits' => 'The :attribute must be :digits digits.',
43 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
44 | 'dimensions' => 'The :attribute has invalid image dimensions.',
45 | 'distinct' => 'The :attribute field has a duplicate value.',
46 | 'email' => 'The :attribute must be a valid email address.',
47 | 'ends_with' => 'The :attribute must end with one of the following: :values.',
48 | 'enum' => 'The selected :attribute is invalid.',
49 | 'exists' => 'The selected :attribute is invalid.',
50 | 'file' => 'The :attribute must be a file.',
51 | 'filled' => 'The :attribute field must have a value.',
52 | 'gt' => [
53 | 'array' => 'The :attribute must have more than :value items.',
54 | 'file' => 'The :attribute must be greater than :value kilobytes.',
55 | 'numeric' => 'The :attribute must be greater than :value.',
56 | 'string' => 'The :attribute must be greater than :value characters.',
57 | ],
58 | 'gte' => [
59 | 'array' => 'The :attribute must have :value items or more.',
60 | 'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
61 | 'numeric' => 'The :attribute must be greater than or equal to :value.',
62 | 'string' => 'The :attribute must be greater than or equal to :value characters.',
63 | ],
64 | 'image' => 'The :attribute must be an image.',
65 | 'in' => 'The selected :attribute is invalid.',
66 | 'in_array' => 'The :attribute field does not exist in :other.',
67 | 'integer' => 'The :attribute must be an integer.',
68 | 'ip' => 'The :attribute must be a valid IP address.',
69 | 'ipv4' => 'The :attribute must be a valid IPv4 address.',
70 | 'ipv6' => 'The :attribute must be a valid IPv6 address.',
71 | 'json' => 'The :attribute must be a valid JSON string.',
72 | 'lt' => [
73 | 'array' => 'The :attribute must have less than :value items.',
74 | 'file' => 'The :attribute must be less than :value kilobytes.',
75 | 'numeric' => 'The :attribute must be less than :value.',
76 | 'string' => 'The :attribute must be less than :value characters.',
77 | ],
78 | 'lte' => [
79 | 'array' => 'The :attribute must not have more than :value items.',
80 | 'file' => 'The :attribute must be less than or equal to :value kilobytes.',
81 | 'numeric' => 'The :attribute must be less than or equal to :value.',
82 | 'string' => 'The :attribute must be less than or equal to :value characters.',
83 | ],
84 | 'mac_address' => 'The :attribute must be a valid MAC address.',
85 | 'max' => [
86 | 'array' => 'The :attribute must not have more than :max items.',
87 | 'file' => 'The :attribute must not be greater than :max kilobytes.',
88 | 'numeric' => 'The :attribute must not be greater than :max.',
89 | 'string' => 'The :attribute must not be greater than :max characters.',
90 | ],
91 | 'mimes' => 'The :attribute must be a file of type: :values.',
92 | 'mimetypes' => 'The :attribute must be a file of type: :values.',
93 | 'min' => [
94 | 'array' => 'The :attribute must have at least :min items.',
95 | 'file' => 'The :attribute must be at least :min kilobytes.',
96 | 'numeric' => 'The :attribute must be at least :min.',
97 | 'string' => 'The :attribute must be at least :min characters.',
98 | ],
99 | 'multiple_of' => 'The :attribute must be a multiple of :value.',
100 | 'not_in' => 'The selected :attribute is invalid.',
101 | 'not_regex' => 'The :attribute format is invalid.',
102 | 'numeric' => 'The :attribute must be a number.',
103 | 'present' => 'The :attribute field must be present.',
104 | 'prohibited' => 'The :attribute field is prohibited.',
105 | 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
106 | 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
107 | 'prohibits' => 'The :attribute field prohibits :other from being present.',
108 | 'regex' => 'The :attribute format is invalid.',
109 | 'required' => 'The :attribute field is required.',
110 | 'required_array_keys' => 'The :attribute field must contain entries for: :values.',
111 | 'required_if' => 'The :attribute field is required when :other is :value.',
112 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
113 | 'required_with' => 'The :attribute field is required when :values is present.',
114 | 'required_with_all' => 'The :attribute field is required when :values are present.',
115 | 'required_without' => 'The :attribute field is required when :values is not present.',
116 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
117 | 'same' => 'The :attribute and :other must match.',
118 | 'size' => [
119 | 'array' => 'The :attribute must contain :size items.',
120 | 'file' => 'The :attribute must be :size kilobytes.',
121 | 'numeric' => 'The :attribute must be :size.',
122 | 'string' => 'The :attribute must be :size characters.',
123 | ],
124 | 'starts_with' => 'The :attribute must start with one of the following: :values.',
125 | 'string' => 'The :attribute must be a string.',
126 | 'timezone' => 'The :attribute must be a valid timezone.',
127 | 'unique' => 'The :attribute has already been taken.',
128 | 'uploaded' => 'The :attribute failed to upload.',
129 | 'url' => 'The :attribute must be a valid URL.',
130 | 'uuid' => 'The :attribute must be a valid UUID.',
131 |
132 | /*
133 | |--------------------------------------------------------------------------
134 | | Custom Validation Language Lines
135 | |--------------------------------------------------------------------------
136 | |
137 | | Here you may specify custom validation messages for attributes using the
138 | | convention "attribute.rule" to name the lines. This makes it quick to
139 | | specify a specific custom language line for a given attribute rule.
140 | |
141 | */
142 |
143 | 'custom' => [
144 | 'attribute-name' => [
145 | 'rule-name' => 'custom-message',
146 | ],
147 | ],
148 |
149 | /*
150 | |--------------------------------------------------------------------------
151 | | Custom Validation Attributes
152 | |--------------------------------------------------------------------------
153 | |
154 | | The following language lines are used to swap our attribute placeholder
155 | | with something more reader friendly such as "E-Mail Address" instead
156 | | of "email". This simply helps us make our message more expressive.
157 | |
158 | */
159 |
160 | 'attributes' => [],
161 |
162 | ];
163 |
--------------------------------------------------------------------------------
/resources/views/welcome.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Laravel
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
22 |
23 |
24 |
58 | Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end.
59 |
71 | Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript development. Check them out, see for yourself, and massively level up your development skills in the process.
72 |
84 | Laravel News is a community driven portal and newsletter aggregating all of the latest and most important news in the Laravel ecosystem, including new package releases and tutorials.
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
Vibrant Ecosystem
93 |
94 |
95 |
96 |
97 | Laravel's robust library of first-party tools and libraries, such as Forge, Vapor, Nova, and Envoyer help you take your projects to the next level. Pair them with powerful open source libraries like Cashier, Dusk, Echo, Horizon, Sanctum, Telescope, and more.
98 |