Stars: 1149
Forks: 266
Pull Requests: 41
Issues: 117
Watchers: 43
Last Updated: 2021-05-30 18:39:54
A Laravel-Nuxt starter kit.
License: MIT License
Languages: PHP, Vue, Shell, Blade
A Laravel-Nuxt starter project template.
composer create-project --prefer-dist cretueusebiu/laravel-nuxt
.env
and set your database connection detailsphp artisan key:generate
and php artisan jwt:secret
)php artisan migrate
npm install
# start Laravel
php artisan serve
# start Nuxt
npm run dev
Access your application at http://localhost:3000
.
npm run build
client/nuxt.config.js
and set ssr: true
.env
to set APP_URL=http://api.example.com
and CLIENT_URL=http://example.com
npm run build
and npm run start
For Nginx you can add a proxy using the follwing location block:
server {
location / {
proxy_pass http://http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
In production you need a process manager to keep the Node server alive forever:
# install pm2 process manager
npm install -g pm2
# startup script
pm2 startup
# start process
pm2 start npm --name "laravel-nuxt" -- run start
# save process list
pm2 save
# list all processes
pm2 l
After each deploy you'll need to restart the process:
pm2 restart laravel-nuxt
Make sure to read the Nuxt docs.
This project comes with GitHub as an example for Laravel Socialite.
To enable the provider create a new GitHub application and use https://example.com/api/oauth/github/callback
as the Authorization callback URL.
Edit .env
and set GITHUB_CLIENT_ID
and GITHUB_CLIENT_SECRET
with the keys form your GitHub application.
For other providers you may need to set the appropriate keys in config/services.php
and redirect url in OAuthController.php
.
To enable email verification make sure that your App\User
model implements the Illuminate\Contracts\Auth\MustVerifyEmail
contract.
client/router.js
.package.json
into client/
and remove config path option from the scripts section. Also make sure to add the env variables in client/.env
.Please see CHANGELOG for more information what has changed recently.