Installation
Create project with composer
Install NPM
Publish vendor files
Create client theme
The .env file
Copy .env
Edit .env
Run webpack / mix
Create database (mysql)
Create a database and a database user, and edit the relevant lines in the .env file. Check the /config/database.php file for the available database connections.
Edit the App Url
Setup
Run setup
Make sure that the LARA_NEEDS_SETUP is set to true in your .env file, and run setup
If the setup wizard has completed successfully, the LARA_NEEDS_SETUP variable will be set to false by the wizard, and you will be redirected to the backend dashboard.
SASS
Tip: if you are working on your client theme, you can tell Mix to only process the selected theme. This can make theme development a lot faster. The relevant variables can be found in the .env file. Possible values are: base, demo, client, admin
MIX_PARTIAL_PROCESS=client
If you are working on your SCSS files, you can even tell Mix to only process the SCSS files, and skip the JS and assets.
MIX_PROCESS_CSS_ONLY=true
Deploy on web server
If you publish the app to a web server, you should move all project folders (except public) one level down, and put them in a folder called /laravel. If you are using a shared server (e.g. Plesk) and your server uses a public folder with a different name (e.g. httpdocs), you should move all public files and folders from /public to /httpdocs. You can then delete the (empty) public folder.
Your folder structure should look like this now:
You should now edit your .env file:
... and your webpack.mix.js file:
... and, if necessary, the bootstrap/app.php file
Tip: if you are copying your Lara project from your local machine to a web server with FTP, you should exclude the following folders:
/laracms/core
/laracms/themes
/node_modules
/vendor
Make sure that both composer.json, and composer.lock are copied to your web server, and run composer install on your server.
You should NOT run composer as root. If you are logged in as root, you should use:
sudo -u [user] composer install
If you are running composer as root, you need to change the ownership of the relevant folders and files:
chown -R [system_user]:psacln ./httpdocs/assets
chown -R [system_user]:psacln ./laravel/laracms
chown -R [system_user]:psacln ./laravel/resources
chown -R [system_user]:psacln ./laravel/vendor
OR in one statement:
chown -R [system_user]:psacln ./httpdocs/assets ./laravel/laracms ./laravel/resources ./laravel/vendor
Last updated