The tartar sauce spaghetti code website of old legos.
- Nginx or Apache (Caddy is an option too)
- PHP (Preferably 8.1.14)
- MariaDB/MySQL
- Redis (Optional)
- Soap
- GD
You set this up like any other Laravel site, and then follow the steps below:
- Run
copy .env.example .env
After you run this, you have to set up your database connections and a few other things. Then, you will place these in the .env file you just created.
APP_KEY
. Leave it blank.
- Create a database table, and make sure the name matches what you put in your .env file.
Also make sure the user you put in your .env file has permissions for that database.
- Run
composer install
to install all the composer packages.
If you get an error, try running composer update
. It could be outdated package versions messing with your composer install.
- After following all the steps, the last two things you need to do is run
php artisan key:generate
&php artisan migrate:fresh --seed
.
The first command generates APP_KEY
, which is used for encryption. An example is the session cookie, for when you either register for the first time or login. The second command creates all the tables in your database, such as the users table or catalog table.
After running all the setup commands, it is time to get your site up. Run the following commands:
-
npm i
-
npm run prod
If you do not wish to use Redis, you can change the following values in your .env file:
-
Change
CACHE_DRIVER=redis
toCACHE_DRIVER=file
-
Change
SESSION_DRIVER=redis
toSESSION_DRIVER=file
---
Are you running the site on Apache and routes are returning 404? Look at this to fix it:
- Make sure your .htaccess in /public/ looks like the following:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
- Add this in your Apache configuration file:
<Directory "/var/www/{DIRECTORY}/public">
Allowoverride All
</Directory>
---
If your site is showing all the files & directories, make sure you added /public to the end of your document root.
---