14 |
15 |
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 John Wanjema
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/LoginController.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('logout');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ConfirmPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/resources/views/auth/verify.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
{{ __('Verify Your Email Address') }}
9 |
10 |
11 | @if (session('resent'))
12 |
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 |
24 |
25 |
26 |
27 |
28 | @endsection
29 |
--------------------------------------------------------------------------------
/public/web.config:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | ./tests/Unit
10 |
11 |
12 | ./tests/Feature
13 |
14 |
15 |
16 |
17 | ./app
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/VerificationController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
39 | $this->middleware('signed')->only('verify');
40 | $this->middleware('throttle:6,1')->only('verify', 'resend');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | $this->faker->name(),
27 | 'email' => $this->faker->unique()->safeEmail(),
28 | 'email_verified_at' => now(),
29 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
30 | 'remember_token' => Str::random(10),
31 | ];
32 | }
33 |
34 | /**
35 | * Indicate that the model's email address should be unverified.
36 | *
37 | * @return \Illuminate\Database\Eloquent\Factories\Factory
38 | */
39 | public function unverified()
40 | {
41 | return $this->state(function (array $attributes) {
42 | return [
43 | 'email_verified_at' => null,
44 | ];
45 | });
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | window._ = require('lodash');
2 |
3 | /**
4 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support
5 | * for JavaScript based Bootstrap features such as modals and tabs. This
6 | * code may be modified to fit the specific needs of your application.
7 | */
8 |
9 | try {
10 | window.Popper = require('popper.js').default;
11 | window.$ = window.jQuery = require('jquery');
12 |
13 | require('bootstrap');
14 | } catch (e) {}
15 |
16 | /**
17 | * We'll load the axios HTTP library which allows us to easily issue requests
18 | * to our Laravel back-end. This library automatically handles sending the
19 | * CSRF token as a header based on the value of the "XSRF" token cookie.
20 | */
21 |
22 | window.axios = require('axios');
23 |
24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
25 |
26 | /**
27 | * Echo exposes an expressive API for subscribing to channels and listening
28 | * for events that are broadcast by Laravel. Echo and event broadcasting
29 | * allows your team to easily build robust real-time web applications.
30 | */
31 |
32 | // import Echo from 'laravel-echo';
33 |
34 | // window.Pusher = require('pusher-js');
35 |
36 | // window.Echo = new Echo({
37 | // broadcaster: 'pusher',
38 | // key: process.env.MIX_PUSHER_APP_KEY,
39 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
40 | // forceTLS: true
41 | // });
42 |
--------------------------------------------------------------------------------
/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' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
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 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class);
50 |
51 | $response = tap($kernel->handle(
52 | $request = Request::capture()
53 | ))->send();
54 |
55 | $kernel->terminate($request, $response);
56 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | configureRateLimiting();
39 |
40 | $this->routes(function () {
41 | Route::prefix('api')
42 | ->middleware('api')
43 | ->namespace($this->namespace)
44 | ->group(base_path('routes/api.php'));
45 |
46 | Route::middleware('web')
47 | ->namespace($this->namespace)
48 | ->group(base_path('routes/web.php'));
49 | });
50 | }
51 |
52 | /**
53 | * Configure the rate limiters for the application.
54 | *
55 | * @return void
56 | */
57 | protected function configureRateLimiting()
58 | {
59 | RateLimiter::for('api', function (Request $request) {
60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
61 | });
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/config/sanctum.php:
--------------------------------------------------------------------------------
1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
17 | '%s%s',
18 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
19 | env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
20 | ))),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Expiration Minutes
25 | |--------------------------------------------------------------------------
26 | |
27 | | This value controls the number of minutes until an issued token will be
28 | | considered expired. If this value is null, personal access tokens do
29 | | not expire. This won't tweak the lifetime of first-party sessions.
30 | |
31 | */
32 |
33 | 'expiration' => null,
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Sanctum Middleware
38 | |--------------------------------------------------------------------------
39 | |
40 | | When authenticating your first-party SPA with Sanctum you may need to
41 | | customize some of the middleware Sanctum uses while processing the
42 | | request. You may change the middleware listed below as required.
43 | |
44 | */
45 |
46 | 'middleware' => [
47 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
48 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
49 | ],
50 |
51 | ];
52 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'useTLS' => true,
41 | ],
42 | ],
43 |
44 | 'ably' => [
45 | 'driver' => 'ably',
46 | 'key' => env('ABLY_KEY'),
47 | ],
48 |
49 | 'redis' => [
50 | 'driver' => 'redis',
51 | 'connection' => 'default',
52 | ],
53 |
54 | 'log' => [
55 | 'driver' => 'log',
56 | ],
57 |
58 | 'null' => [
59 | 'driver' => 'null',
60 | ],
61 |
62 | ],
63 |
64 | ];
65 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/email.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
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"
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 | 'auth_mode' => null,
46 | ],
47 |
48 | 'ses' => [
49 | 'transport' => 'ses',
50 | ],
51 |
52 | 'mailgun' => [
53 | 'transport' => 'mailgun',
54 | ],
55 |
56 | 'postmark' => [
57 | 'transport' => 'postmark',
58 | ],
59 |
60 | 'sendmail' => [
61 | 'transport' => 'sendmail',
62 | 'path' => '/usr/sbin/sendmail -bs',
63 | ],
64 |
65 | 'log' => [
66 | 'transport' => 'log',
67 | 'channel' => env('MAIL_LOG_CHANNEL'),
68 | ],
69 |
70 | 'array' => [
71 | 'transport' => 'array',
72 | ],
73 |
74 | 'failover' => [
75 | 'transport' => 'failover',
76 | 'mailers' => [
77 | 'smtp',
78 | 'log',
79 | ],
80 | ],
81 | ],
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Global "From" Address
86 | |--------------------------------------------------------------------------
87 | |
88 | | You may wish for all e-mails sent by your application to be sent from
89 | | the same address. Here, you may specify a name and address that is
90 | | used globally for all e-mails that are sent by your application.
91 | |
92 | */
93 |
94 | 'from' => [
95 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
96 | 'name' => env('MAIL_FROM_NAME', 'Example'),
97 | ],
98 |
99 | /*
100 | |--------------------------------------------------------------------------
101 | | Markdown Mail Settings
102 | |--------------------------------------------------------------------------
103 | |
104 | | If you are using Markdown based email rendering, you may configure your
105 | | theme and component paths here, allowing you to customize the design
106 | | of the emails. Or, you may simply stick with the Laravel defaults!
107 | |
108 | */
109 |
110 | 'markdown' => [
111 | 'theme' => 'default',
112 |
113 | 'paths' => [
114 | resource_path('views/vendor/mail'),
115 | ],
116 | ],
117 |
118 | ];
119 |
--------------------------------------------------------------------------------
/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 | 'api' => [
44 | 'driver' => 'passport',
45 | 'provider' => 'users',
46 | ],
47 | ],
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | User Providers
52 | |--------------------------------------------------------------------------
53 | |
54 | | All authentication drivers have a user provider. This defines how the
55 | | users are actually retrieved out of your database or other storage
56 | | mechanisms used by this application to persist your user's data.
57 | |
58 | | If you have multiple user tables or models you may configure multiple
59 | | sources which represent each model / table. These sources may then
60 | | be assigned to any extra authentication guards you have defined.
61 | |
62 | | Supported: "database", "eloquent"
63 | |
64 | */
65 |
66 | 'providers' => [
67 | 'users' => [
68 | 'driver' => 'eloquent',
69 | 'model' => App\Models\User::class,
70 | ],
71 |
72 | // 'users' => [
73 | // 'driver' => 'database',
74 | // 'table' => 'users',
75 | // ],
76 | ],
77 |
78 | /*
79 | |--------------------------------------------------------------------------
80 | | Resetting Passwords
81 | |--------------------------------------------------------------------------
82 | |
83 | | You may specify multiple password reset configurations if you have more
84 | | than one user table or model in the application and you want to have
85 | | separate password reset settings based on the specific user types.
86 | |
87 | | The expire time is the number of minutes that the reset token should be
88 | | considered valid. This security feature keeps tokens short-lived so
89 | | they have less time to be guessed. You may change this as needed.
90 | |
91 | */
92 |
93 | 'passwords' => [
94 | 'users' => [
95 | 'provider' => 'users',
96 | 'table' => 'password_resets',
97 | 'expire' => 60,
98 | 'throttle' => 60,
99 | ],
100 | ],
101 |
102 | /*
103 | |--------------------------------------------------------------------------
104 | | Password Confirmation Timeout
105 | |--------------------------------------------------------------------------
106 | |
107 | | Here you may define the amount of seconds before a password confirmation
108 | | times out and the user is prompted to re-enter their password via the
109 | | confirmation screen. By default, the timeout lasts for three hours.
110 | |
111 | */
112 |
113 | 'password_timeout' => 10800,
114 |
115 | ];
116 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Ever wondered how to setup Vue in your laravel project.
2 | 
3 | ## Laravel
4 | Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
5 | Here is a link to their Documentation.
6 | ### [Laravel](https://laravel.com/docs/8.x)
7 |
8 | ## Vue
9 | Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
10 | Here is the link to their documentation.
11 | ### [Vue js](https://vuejs.org/)
12 |
13 |
14 | ## Why use Laravel with Vue
15 | ### Streamline the Development Process
16 | This structure allows for one to be a full stack developer within a single project
17 |
18 | ### Single-Page Application Development
19 | Both Vue js and Laravel support single page applications.This allows the application assets get loaded once, all that your application does as the user engages with it is request data which typically requires low bandwidth to fulfill.
20 |
21 | ### Building Optimal Complex Front-end Pages
22 | With Vuejs a developer does not need to use jquery to manipulate blade templates.Vue allows for easier managment of DOM using a virtual Dom.
23 |
24 | ### Easy to Learn and Use
25 | Both Laravel and Vue have a robust documentation that is easy to learn and integrate.
26 |
27 | ### First ensure that Laravel is installed.
28 | ### Here is link to install Laravel if you haven't.
29 |
30 | #### [Laravel 8 Installation](https://laravel.com/docs/8.x/installation)
31 |
32 | ## Create a laravel project
33 | ```bash
34 | composer create-project laravel/laravel laravel-vue
35 | ```
36 |
37 | ## Scaffolding Vue js
38 | ### Install laravel/ui package
39 | ```bash
40 | composer require laravel/ui
41 | ```
42 | ### Install the frontend scaffolding using the ui Artisan command
43 | #### Basic scaffolding
44 | ```bash
45 | php artisan ui vue
46 | ```
47 | #### Generate Auth scaffolding.
48 | ```bash
49 | php artisan ui vue
50 | ```
51 | #### Compile your fresh scaffolding.
52 | ```bash
53 | npm install && npm run dev
54 | ```
55 |
56 | ### Configure Blade
57 | #### Import app.js and add app id
58 | ```bash
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | Laravel Vue
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
Laravel Vue
79 |
80 |
81 |
82 |
83 |
84 | ```
85 | ### Add Vue components
86 | #### Add new vue.js file in resources/js/components called app.vue and add the following code.
87 | ```bash
88 |
89 |
90 | {{message}}
91 |
92 |
93 |
102 | ```
103 | ## Setup Vue router
104 |
105 | ### Install Vue router
106 | ```
107 | npm install vue-router --save
108 | ```
109 | #### Create a routes folder and add a home.js file.Add the following code.
110 | ```
111 | const home = () =>import ( '../components/app.vue')
112 |
113 | export default [
114 | {
115 | path: '/home',
116 | component: home,
117 | name: 'home',
118 | },
119 | ]
120 | ```
121 | #### Head over to the resources/js folder and create a file called routes.js and add the following code.
122 | ```
123 | import Vue from 'vue'
124 | import VueRouter from 'vue-router'
125 | import home from './routes/home';
126 |
127 | Vue.use(VueRouter);
128 | export default new VueRouter({
129 | mode: 'history',
130 | scrollBehavior: (to, from, savedPosition) => ({ y: 0 }),
131 | routes: [
132 | ...home,
133 | ],
134 | });
135 | ```
136 | ### Add routes to app.js
137 | #### Replace the code in your resources/js/app.js with the code below.
138 | ```
139 | require('./bootstrap');
140 | require('../sass/app.scss')
141 | import Vue from 'vue'
142 |
143 | window.Vue = require('vue');
144 |
145 | // router
146 | import router from './routes.js';
147 | window.router = router;
148 | window.Fire = new Vue();
149 |
150 | const app = new Vue({
151 | el: '#app',
152 | router,
153 | }).$mount('#app');
154 | ```
155 | ### Setup Laravel routes
156 | #### Update Laravel routes in web.php
157 | ```
158 | Route::get('/{any?}', [
159 | function () {
160 | return view('welcome');
161 | }
162 | ])->where('any', '.*');
163 | ```
164 | ## Run the application
165 | ### Start Laravel app
166 | ```
167 | php artisan serve
168 | ```
169 | ### Compile components
170 | ```
171 | npm run dev
172 | ```
173 | ### Access the application at localhost:8000
174 | #### Open [localhost:8000](http://localhost:8000/)
175 |
176 | ### Link to Github repo.
177 |
178 | ### [Github repository](https://github.com/johnwanjema/Getting-startes-with-Laravel-and-Vue-js)
179 |
180 | ### Happy coding
181 |
182 |
--------------------------------------------------------------------------------
/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 | 'schema' => '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 | ],
93 |
94 | ],
95 |
96 | /*
97 | |--------------------------------------------------------------------------
98 | | Migration Repository Table
99 | |--------------------------------------------------------------------------
100 | |
101 | | This table keeps track of all the migrations that have already run for
102 | | your application. Using this information, we can determine which of
103 | | the migrations on disk haven't actually been run in the database.
104 | |
105 | */
106 |
107 | 'migrations' => 'migrations',
108 |
109 | /*
110 | |--------------------------------------------------------------------------
111 | | Redis Databases
112 | |--------------------------------------------------------------------------
113 | |
114 | | Redis is an open source, fast, and advanced key-value store that also
115 | | provides a richer body of commands than a typical key-value system
116 | | such as APC or Memcached. Laravel makes it easy to dig right in.
117 | |
118 | */
119 |
120 | 'redis' => [
121 |
122 | 'client' => env('REDIS_CLIENT', 'phpredis'),
123 |
124 | 'options' => [
125 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
126 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
127 | ],
128 |
129 | 'default' => [
130 | 'url' => env('REDIS_URL'),
131 | 'host' => env('REDIS_HOST', '127.0.0.1'),
132 | 'password' => env('REDIS_PASSWORD', null),
133 | 'port' => env('REDIS_PORT', '6379'),
134 | 'database' => env('REDIS_DB', '0'),
135 | ],
136 |
137 | 'cache' => [
138 | 'url' => env('REDIS_URL'),
139 | 'host' => env('REDIS_HOST', '127.0.0.1'),
140 | 'password' => env('REDIS_PASSWORD', null),
141 | 'port' => env('REDIS_PORT', '6379'),
142 | 'database' => env('REDIS_CACHE_DB', '1'),
143 | ],
144 |
145 | ],
146 |
147 | ];
148 |
--------------------------------------------------------------------------------
/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', null),
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', null),
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', null),
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 |
--------------------------------------------------------------------------------
/resources/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 | 'numeric' => 'The :attribute must be between :min and :max.',
29 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
30 | 'string' => 'The :attribute must be between :min and :max characters.',
31 | 'array' => 'The :attribute must have between :min and :max items.',
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 | 'different' => 'The :attribute and :other must be different.',
40 | 'digits' => 'The :attribute must be :digits digits.',
41 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
42 | 'dimensions' => 'The :attribute has invalid image dimensions.',
43 | 'distinct' => 'The :attribute field has a duplicate value.',
44 | 'email' => 'The :attribute must be a valid email address.',
45 | 'ends_with' => 'The :attribute must end with one of the following: :values.',
46 | 'exists' => 'The selected :attribute is invalid.',
47 | 'file' => 'The :attribute must be a file.',
48 | 'filled' => 'The :attribute field must have a value.',
49 | 'gt' => [
50 | 'numeric' => 'The :attribute must be greater than :value.',
51 | 'file' => 'The :attribute must be greater than :value kilobytes.',
52 | 'string' => 'The :attribute must be greater than :value characters.',
53 | 'array' => 'The :attribute must have more than :value items.',
54 | ],
55 | 'gte' => [
56 | 'numeric' => 'The :attribute must be greater than or equal :value.',
57 | 'file' => 'The :attribute must be greater than or equal :value kilobytes.',
58 | 'string' => 'The :attribute must be greater than or equal :value characters.',
59 | 'array' => 'The :attribute must have :value items or more.',
60 | ],
61 | 'image' => 'The :attribute must be an image.',
62 | 'in' => 'The selected :attribute is invalid.',
63 | 'in_array' => 'The :attribute field does not exist in :other.',
64 | 'integer' => 'The :attribute must be an integer.',
65 | 'ip' => 'The :attribute must be a valid IP address.',
66 | 'ipv4' => 'The :attribute must be a valid IPv4 address.',
67 | 'ipv6' => 'The :attribute must be a valid IPv6 address.',
68 | 'json' => 'The :attribute must be a valid JSON string.',
69 | 'lt' => [
70 | 'numeric' => 'The :attribute must be less than :value.',
71 | 'file' => 'The :attribute must be less than :value kilobytes.',
72 | 'string' => 'The :attribute must be less than :value characters.',
73 | 'array' => 'The :attribute must have less than :value items.',
74 | ],
75 | 'lte' => [
76 | 'numeric' => 'The :attribute must be less than or equal :value.',
77 | 'file' => 'The :attribute must be less than or equal :value kilobytes.',
78 | 'string' => 'The :attribute must be less than or equal :value characters.',
79 | 'array' => 'The :attribute must not have more than :value items.',
80 | ],
81 | 'max' => [
82 | 'numeric' => 'The :attribute must not be greater than :max.',
83 | 'file' => 'The :attribute must not be greater than :max kilobytes.',
84 | 'string' => 'The :attribute must not be greater than :max characters.',
85 | 'array' => 'The :attribute must not have more than :max items.',
86 | ],
87 | 'mimes' => 'The :attribute must be a file of type: :values.',
88 | 'mimetypes' => 'The :attribute must be a file of type: :values.',
89 | 'min' => [
90 | 'numeric' => 'The :attribute must be at least :min.',
91 | 'file' => 'The :attribute must be at least :min kilobytes.',
92 | 'string' => 'The :attribute must be at least :min characters.',
93 | 'array' => 'The :attribute must have at least :min items.',
94 | ],
95 | 'multiple_of' => 'The :attribute must be a multiple of :value.',
96 | 'not_in' => 'The selected :attribute is invalid.',
97 | 'not_regex' => 'The :attribute format is invalid.',
98 | 'numeric' => 'The :attribute must be a number.',
99 | 'password' => 'The password is incorrect.',
100 | 'present' => 'The :attribute field must be present.',
101 | 'regex' => 'The :attribute format is invalid.',
102 | 'required' => 'The :attribute field is required.',
103 | 'required_if' => 'The :attribute field is required when :other is :value.',
104 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
105 | 'required_with' => 'The :attribute field is required when :values is present.',
106 | 'required_with_all' => 'The :attribute field is required when :values are present.',
107 | 'required_without' => 'The :attribute field is required when :values is not present.',
108 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
109 | 'prohibited' => 'The :attribute field is prohibited.',
110 | 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
111 | 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
112 | 'prohibits' => 'The :attribute field prohibits :other from being present.',
113 | 'same' => 'The :attribute and :other must match.',
114 | 'size' => [
115 | 'numeric' => 'The :attribute must be :size.',
116 | 'file' => 'The :attribute must be :size kilobytes.',
117 | 'string' => 'The :attribute must be :size characters.',
118 | 'array' => 'The :attribute must contain :size items.',
119 | ],
120 | 'starts_with' => 'The :attribute must start with one of the following: :values.',
121 | 'string' => 'The :attribute must be a string.',
122 | 'timezone' => 'The :attribute must be a valid timezone.',
123 | 'unique' => 'The :attribute has already been taken.',
124 | 'uploaded' => 'The :attribute failed to upload.',
125 | 'url' => 'The :attribute must be a valid URL.',
126 | 'uuid' => 'The :attribute must be a valid UUID.',
127 |
128 | /*
129 | |--------------------------------------------------------------------------
130 | | Custom Validation Language Lines
131 | |--------------------------------------------------------------------------
132 | |
133 | | Here you may specify custom validation messages for attributes using the
134 | | convention "attribute.rule" to name the lines. This makes it quick to
135 | | specify a specific custom language line for a given attribute rule.
136 | |
137 | */
138 |
139 | 'custom' => [
140 | 'attribute-name' => [
141 | 'rule-name' => 'custom-message',
142 | ],
143 | ],
144 |
145 | /*
146 | |--------------------------------------------------------------------------
147 | | Custom Validation Attributes
148 | |--------------------------------------------------------------------------
149 | |
150 | | The following language lines are used to swap our attribute placeholder
151 | | with something more reader friendly such as "E-Mail Address" instead
152 | | of "email". This simply helps us make our message more expressive.
153 | |
154 | */
155 |
156 | 'attributes' => [],
157 |
158 | ];
159 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application Environment
21 | |--------------------------------------------------------------------------
22 | |
23 | | This value determines the "environment" your application is currently
24 | | running in. This may determine how you prefer to configure various
25 | | services the application utilizes. Set this in your ".env" file.
26 | |
27 | */
28 |
29 | 'env' => env('APP_ENV', 'production'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application Debug Mode
34 | |--------------------------------------------------------------------------
35 | |
36 | | When your application is in debug mode, detailed error messages with
37 | | stack traces will be shown on every error that occurs within your
38 | | application. If disabled, a simple generic error page is shown.
39 | |
40 | */
41 |
42 | 'debug' => (bool) env('APP_DEBUG', false),
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application URL
47 | |--------------------------------------------------------------------------
48 | |
49 | | This URL is used by the console to properly generate URLs when using
50 | | the Artisan command line tool. You should set this to the root of
51 | | your application so that it is used when running Artisan tasks.
52 | |
53 | */
54 |
55 | 'url' => env('APP_URL', 'http://localhost'),
56 |
57 | 'asset_url' => env('ASSET_URL', null),
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | Application Timezone
62 | |--------------------------------------------------------------------------
63 | |
64 | | Here you may specify the default timezone for your application, which
65 | | will be used by the PHP date and date-time functions. We have gone
66 | | ahead and set this to a sensible default for you out of the box.
67 | |
68 | */
69 |
70 | 'timezone' => 'UTC',
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | Application Locale Configuration
75 | |--------------------------------------------------------------------------
76 | |
77 | | The application locale determines the default locale that will be used
78 | | by the translation service provider. You are free to set this value
79 | | to any of the locales which will be supported by the application.
80 | |
81 | */
82 |
83 | 'locale' => 'en',
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | Application Fallback Locale
88 | |--------------------------------------------------------------------------
89 | |
90 | | The fallback locale determines the locale to use when the current one
91 | | is not available. You may change the value to correspond to any of
92 | | the language folders that are provided through your application.
93 | |
94 | */
95 |
96 | 'fallback_locale' => 'en',
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Faker Locale
101 | |--------------------------------------------------------------------------
102 | |
103 | | This locale will be used by the Faker PHP library when generating fake
104 | | data for your database seeds. For example, this will be used to get
105 | | localized telephone numbers, street address information and more.
106 | |
107 | */
108 |
109 | 'faker_locale' => 'en_US',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Encryption Key
114 | |--------------------------------------------------------------------------
115 | |
116 | | This key is used by the Illuminate encrypter service and should be set
117 | | to a random, 32 character string, otherwise these encrypted strings
118 | | will not be safe. Please do this before deploying an application!
119 | |
120 | */
121 |
122 | 'key' => env('APP_KEY'),
123 |
124 | 'cipher' => 'AES-256-CBC',
125 |
126 | /*
127 | |--------------------------------------------------------------------------
128 | | Autoloaded Service Providers
129 | |--------------------------------------------------------------------------
130 | |
131 | | The service providers listed here will be automatically loaded on the
132 | | request to your application. Feel free to add your own services to
133 | | this array to grant expanded functionality to your applications.
134 | |
135 | */
136 |
137 | 'providers' => [
138 |
139 | /*
140 | * Laravel Framework Service Providers...
141 | */
142 | Illuminate\Auth\AuthServiceProvider::class,
143 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
144 | Illuminate\Bus\BusServiceProvider::class,
145 | Illuminate\Cache\CacheServiceProvider::class,
146 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
147 | Illuminate\Cookie\CookieServiceProvider::class,
148 | Illuminate\Database\DatabaseServiceProvider::class,
149 | Illuminate\Encryption\EncryptionServiceProvider::class,
150 | Illuminate\Filesystem\FilesystemServiceProvider::class,
151 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
152 | Illuminate\Hashing\HashServiceProvider::class,
153 | Illuminate\Mail\MailServiceProvider::class,
154 | Illuminate\Notifications\NotificationServiceProvider::class,
155 | Illuminate\Pagination\PaginationServiceProvider::class,
156 | Illuminate\Pipeline\PipelineServiceProvider::class,
157 | Illuminate\Queue\QueueServiceProvider::class,
158 | Illuminate\Redis\RedisServiceProvider::class,
159 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
160 | Illuminate\Session\SessionServiceProvider::class,
161 | Illuminate\Translation\TranslationServiceProvider::class,
162 | Illuminate\Validation\ValidationServiceProvider::class,
163 | Illuminate\View\ViewServiceProvider::class,
164 |
165 | /*
166 | * Package Service Providers...
167 | */
168 |
169 | /*
170 | * Application Service Providers...
171 | */
172 | App\Providers\AppServiceProvider::class,
173 | App\Providers\AuthServiceProvider::class,
174 | // App\Providers\BroadcastServiceProvider::class,
175 | App\Providers\EventServiceProvider::class,
176 | App\Providers\RouteServiceProvider::class,
177 |
178 | ],
179 |
180 | /*
181 | |--------------------------------------------------------------------------
182 | | Class Aliases
183 | |--------------------------------------------------------------------------
184 | |
185 | | This array of class aliases will be registered when this application
186 | | is started. However, feel free to register as many as you wish as
187 | | the aliases are "lazy" loaded so they don't hinder performance.
188 | |
189 | */
190 |
191 | 'aliases' => [
192 |
193 | 'App' => Illuminate\Support\Facades\App::class,
194 | 'Arr' => Illuminate\Support\Arr::class,
195 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
196 | 'Auth' => Illuminate\Support\Facades\Auth::class,
197 | 'Blade' => Illuminate\Support\Facades\Blade::class,
198 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
199 | 'Bus' => Illuminate\Support\Facades\Bus::class,
200 | 'Cache' => Illuminate\Support\Facades\Cache::class,
201 | 'Config' => Illuminate\Support\Facades\Config::class,
202 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
203 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
204 | 'Date' => Illuminate\Support\Facades\Date::class,
205 | 'DB' => Illuminate\Support\Facades\DB::class,
206 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
207 | 'Event' => Illuminate\Support\Facades\Event::class,
208 | 'File' => Illuminate\Support\Facades\File::class,
209 | 'Gate' => Illuminate\Support\Facades\Gate::class,
210 | 'Hash' => Illuminate\Support\Facades\Hash::class,
211 | 'Http' => Illuminate\Support\Facades\Http::class,
212 | 'Lang' => Illuminate\Support\Facades\Lang::class,
213 | 'Log' => Illuminate\Support\Facades\Log::class,
214 | 'Mail' => Illuminate\Support\Facades\Mail::class,
215 | 'Notification' => Illuminate\Support\Facades\Notification::class,
216 | 'Password' => Illuminate\Support\Facades\Password::class,
217 | 'Queue' => Illuminate\Support\Facades\Queue::class,
218 | 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
219 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
220 | // 'Redis' => Illuminate\Support\Facades\Redis::class,
221 | 'Request' => Illuminate\Support\Facades\Request::class,
222 | 'Response' => Illuminate\Support\Facades\Response::class,
223 | 'Route' => Illuminate\Support\Facades\Route::class,
224 | 'Schema' => Illuminate\Support\Facades\Schema::class,
225 | 'Session' => Illuminate\Support\Facades\Session::class,
226 | 'Storage' => Illuminate\Support\Facades\Storage::class,
227 | 'Str' => Illuminate\Support\Str::class,
228 | 'URL' => Illuminate\Support\Facades\URL::class,
229 | 'Validator' => Illuminate\Support\Facades\Validator::class,
230 | 'View' => Illuminate\Support\Facades\View::class,
231 |
232 | ],
233 |
234 | ];
235 |
--------------------------------------------------------------------------------
/public/js/resources_js_components_app_vue.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_components_app_vue"],{
3 |
4 | /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/components/app.vue?vue&type=script&lang=js&":
5 | /*!**********************************************************************************************************************************************************************************************************!*\
6 | !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/components/app.vue?vue&type=script&lang=js& ***!
7 | \**********************************************************************************************************************************************************************************************************/
8 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9 |
10 | __webpack_require__.r(__webpack_exports__);
11 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13 | /* harmony export */ });
14 | //
15 | //
16 | //
17 | //
18 | //
19 | //
20 | //
21 | //
22 | //
23 | //
24 | //
25 | //
26 | //
27 | //
28 | //
29 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
30 | data: function data() {
31 | return {
32 | message: 'Hello World',
33 | user: {}
34 | };
35 | },
36 | methods: {
37 | getAuthUser: function getAuthUser() {
38 | var _this = this;
39 |
40 | axios.get('/api/get-authenticated-user').then(function (_ref) {
41 | var data = _ref.data;
42 | // console.log(data)
43 | _this.user = data.data;
44 | })["catch"](function (error) {
45 | console.log(error);
46 | });
47 | }
48 | },
49 | created: function created() {
50 | this.getAuthUser();
51 | }
52 | });
53 |
54 | /***/ }),
55 |
56 | /***/ "./resources/js/components/app.vue":
57 | /*!*****************************************!*\
58 | !*** ./resources/js/components/app.vue ***!
59 | \*****************************************/
60 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
61 |
62 | __webpack_require__.r(__webpack_exports__);
63 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
64 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
65 | /* harmony export */ });
66 | /* harmony import */ var _app_vue_vue_type_template_id_f9a0fcb4___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./app.vue?vue&type=template&id=f9a0fcb4& */ "./resources/js/components/app.vue?vue&type=template&id=f9a0fcb4&");
67 | /* harmony import */ var _app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./app.vue?vue&type=script&lang=js& */ "./resources/js/components/app.vue?vue&type=script&lang=js&");
68 | /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
69 |
70 |
71 |
72 |
73 |
74 | /* normalize component */
75 | ;
76 | var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
77 | _app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
78 | _app_vue_vue_type_template_id_f9a0fcb4___WEBPACK_IMPORTED_MODULE_0__.render,
79 | _app_vue_vue_type_template_id_f9a0fcb4___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns,
80 | false,
81 | null,
82 | null,
83 | null
84 |
85 | )
86 |
87 | /* hot reload */
88 | if (false) { var api; }
89 | component.options.__file = "resources/js/components/app.vue"
90 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports);
91 |
92 | /***/ }),
93 |
94 | /***/ "./resources/js/components/app.vue?vue&type=script&lang=js&":
95 | /*!******************************************************************!*\
96 | !*** ./resources/js/components/app.vue?vue&type=script&lang=js& ***!
97 | \******************************************************************/
98 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
99 |
100 | __webpack_require__.r(__webpack_exports__);
101 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
102 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
103 | /* harmony export */ });
104 | /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/components/app.vue?vue&type=script&lang=js&");
105 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_app_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
106 |
107 | /***/ }),
108 |
109 | /***/ "./resources/js/components/app.vue?vue&type=template&id=f9a0fcb4&":
110 | /*!************************************************************************!*\
111 | !*** ./resources/js/components/app.vue?vue&type=template&id=f9a0fcb4& ***!
112 | \************************************************************************/
113 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
114 |
115 | __webpack_require__.r(__webpack_exports__);
116 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
117 | /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_app_vue_vue_type_template_id_f9a0fcb4___WEBPACK_IMPORTED_MODULE_0__.render),
118 | /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_app_vue_vue_type_template_id_f9a0fcb4___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns)
119 | /* harmony export */ });
120 | /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_app_vue_vue_type_template_id_f9a0fcb4___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=template&id=f9a0fcb4& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/components/app.vue?vue&type=template&id=f9a0fcb4&");
121 |
122 |
123 | /***/ }),
124 |
125 | /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/components/app.vue?vue&type=template&id=f9a0fcb4&":
126 | /*!***************************************************************************************************************************************************************************************************************!*\
127 | !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/components/app.vue?vue&type=template&id=f9a0fcb4& ***!
128 | \***************************************************************************************************************************************************************************************************************/
129 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
130 |
131 | __webpack_require__.r(__webpack_exports__);
132 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
133 | /* harmony export */ "render": () => (/* binding */ render),
134 | /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns)
135 | /* harmony export */ });
136 | var render = function() {
137 | var _vm = this
138 | var _h = _vm.$createElement
139 | var _c = _vm._self._c || _h
140 | return _c("div", { staticClass: "container" }, [
141 | _c("div", { staticClass: "row justify-content-center" }, [
142 | _c("div", { staticClass: "col-md-8" }, [
143 | _c("div", { staticClass: "card" }, [
144 | _c("div", { staticClass: "card-header" }, [
145 | _vm._v("Example Component Laravel Vue")
146 | ]),
147 | _vm._v(" "),
148 | _c("div", { staticClass: "card-body" }, [
149 | _vm._v(
150 | "\n Auth User name : " +
151 | _vm._s(_vm.user.name) +
152 | "\n "
153 | )
154 | ])
155 | ])
156 | ])
157 | ])
158 | ])
159 | }
160 | var staticRenderFns = []
161 | render._withStripped = true
162 |
163 |
164 |
165 | /***/ }),
166 |
167 | /***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js":
168 | /*!********************************************************************!*\
169 | !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***!
170 | \********************************************************************/
171 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
172 |
173 | __webpack_require__.r(__webpack_exports__);
174 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
175 | /* harmony export */ "default": () => (/* binding */ normalizeComponent)
176 | /* harmony export */ });
177 | /* globals __VUE_SSR_CONTEXT__ */
178 |
179 | // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
180 | // This module is a runtime utility for cleaner component module output and will
181 | // be included in the final webpack user bundle.
182 |
183 | function normalizeComponent (
184 | scriptExports,
185 | render,
186 | staticRenderFns,
187 | functionalTemplate,
188 | injectStyles,
189 | scopeId,
190 | moduleIdentifier, /* server only */
191 | shadowMode /* vue-cli only */
192 | ) {
193 | // Vue.extend constructor export interop
194 | var options = typeof scriptExports === 'function'
195 | ? scriptExports.options
196 | : scriptExports
197 |
198 | // render functions
199 | if (render) {
200 | options.render = render
201 | options.staticRenderFns = staticRenderFns
202 | options._compiled = true
203 | }
204 |
205 | // functional template
206 | if (functionalTemplate) {
207 | options.functional = true
208 | }
209 |
210 | // scopedId
211 | if (scopeId) {
212 | options._scopeId = 'data-v-' + scopeId
213 | }
214 |
215 | var hook
216 | if (moduleIdentifier) { // server build
217 | hook = function (context) {
218 | // 2.3 injection
219 | context =
220 | context || // cached call
221 | (this.$vnode && this.$vnode.ssrContext) || // stateful
222 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
223 | // 2.2 with runInNewContext: true
224 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
225 | context = __VUE_SSR_CONTEXT__
226 | }
227 | // inject component styles
228 | if (injectStyles) {
229 | injectStyles.call(this, context)
230 | }
231 | // register component module identifier for async chunk inferrence
232 | if (context && context._registeredComponents) {
233 | context._registeredComponents.add(moduleIdentifier)
234 | }
235 | }
236 | // used by ssr in case component is cached and beforeCreate
237 | // never gets called
238 | options._ssrRegister = hook
239 | } else if (injectStyles) {
240 | hook = shadowMode
241 | ? function () {
242 | injectStyles.call(
243 | this,
244 | (options.functional ? this.parent : this).$root.$options.shadowRoot
245 | )
246 | }
247 | : injectStyles
248 | }
249 |
250 | if (hook) {
251 | if (options.functional) {
252 | // for template-only hot-reload because in that case the render fn doesn't
253 | // go through the normalizer
254 | options._injectStyles = hook
255 | // register for functional component in vue file
256 | var originalRender = options.render
257 | options.render = function renderWithStyleInjection (h, context) {
258 | hook.call(context)
259 | return originalRender(h, context)
260 | }
261 | } else {
262 | // inject component registration as beforeCreate hook
263 | var existing = options.beforeCreate
264 | options.beforeCreate = existing
265 | ? [].concat(existing, hook)
266 | : [hook]
267 | }
268 | }
269 |
270 | return {
271 | exports: scriptExports,
272 | options: options
273 | }
274 | }
275 |
276 |
277 | /***/ })
278 |
279 | }]);
--------------------------------------------------------------------------------
/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 |