Comments (2)
Hi @bitfactory-sarah-tammenga,
Let's clarify some things in advance:
PHP is a server side scripting language and, in production, will need to be set up properly through a web server and a process manager (e.g. nginx + php-fpm)
Consequently this module does not provide any means to serve a production ready PHP server. Please plan accordingly
The module disables Laravel support if it is unable to find the artisan
PHP executable, which is located at the root of a Laravel project folder.
If you do not already have one please follow the following steps to create one (see https://laravel.com/docs/7.x/installation#installing-laravel):
- setup PHP and composer on your system (depending on which operating system you use this step may vary)
Here are some resources to get you started: - Globally install the laravel installer:
composer require global laravel/installer
- Create a new laravel project:
laravel new projectName
Note: this will create a folder namedprojectName
, containing a full laravel installation, under the current working directory (i.e. the folder form which the command was executed)
Once you have a laravel project setup you can direct this module to it's directory as follows:
In nuxt.config.js
:
export default {
// ...
modules: [
'nuxt-laravel'
// ...
],
// ...
laravel: {
// A relative path will be resolved relative to the current working directory (i.e. the directory you execute 'yarn dev' from
root: 'relative/path/to/laravel/project/directory'
// An absolute path (note the leading '/') will be used as is
root: '/absolute/path/to/laravel/project/directory'
}
}
After the root is set the module should work correctly.
from nuxt-laravel.
Also:
Laravel will not support this module natively, in order for Laravel to proxy calls to NuxtJS's internal router you need to configure a route (see: https://github.com/m2sd/nuxt-laravel#forwarding-all-undefined-routes-to-nuxt and mind the router.base
setting in your nuxt.config.js
, as this must be the prefix for any route which proxies to nuxt)
Alternatively (if you want to start fresh):
You can use the m2s/larave-nuxt
plugin as descibed here: https://github.com/m2sd/nuxt-laravel#the-easy-way
from nuxt-laravel.
Related Issues (14)
- Windows path problem HOT 3
- Axios uses wrong port HOT 19
- Route [nuxt] not defined.
- Rendering meta tags in server side while there is no SSR by now
- Wrong named output file in publicDir HOT 2
- Missing closing bracket in readme
- Added Support to Nuxt Content
- 'render-before' hook deletes entire public directory HOT 3
- Strange behavior with PHP 7.4 HOT 1
- SSR HOT 9
- Rendering everything to one JS file HOT 2
- How to access to cookies and sessions from nuxt side HOT 4
- No spa.html HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt-laravel.