Laravel 9 Web Application for the Taksidiotes Game Web app
After cloning the project, create an .env file (should be a copy of .env.example), containing the information about your database name and credentials:
cp .env.example .envTake a look at the .env file that was created. You may need to update the DB_* variables, in order to set up the DB
connection.
Also, make sure that the APP_URL is set to the correct domain and port that you will be using.
-
Make sure php 8.0 (or newer) is installed.
-
After cloning the project, create an .env file (should be a copy of .env.example), containing the information about your database name and credentials. Then run
php artisan migrateto create the DB schema andphp artisan db:seedin order to insert the starter data to the DB -
Install laravel/back-end dependencies
composer install- Front-end dependencies
If you are using nvm, run this command in order to sync to the correct NodeJS version for the project:
nvm useThen, install and compile the front-end dependencies:
npm install
npm run dev- Create the symbolic link for user-uploaded files.
php artisan storage:linkin order to link the /public/storage folder with the /storage/app/public directory.
This application uses Spatie - Laravel Sitemap plugin, in order to create
the public/sitemap.xml file (which is excluded from git), that will be crawled by the search engines.
In order to run the generator for the current application installation, run the embedded Laravel command:
php artisan sitemap:generateThis application uses Laravel Pint in order to perform code-style.
In order to run the styler, run :
./vendor/bin/pint --test -v # the --test will not do any changes, it will just output the changes needed
./vendor/bin/pint -v # this command will actually perform the code style changes
% sudo touch /etc/apache2/sites-available/taxidiotes.conf
% sudo nano /etc/apache2/sites-available/taxidiotes.conf
<VirtualHost *:80>
ServerName dev.taxidiotes
ServerAlias dev.taxidiotes
DocumentRoot "/home/path/to/project/public"
<Directory "/home/path/to/project/public">
Require all granted
AllowOverride all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Make the symbolic link:
% cd /etc/apache2/sites-enabled && sudo ln -s ../sites-available/taxidiotes.confEnable mod_rewrite, mod_ssl and restart apache:
% sudo a2enmod rewrite && sudo a2enmod ssl && sudo service apache2 restartFix permissions for storage directory:
sudo chown -R ${USER}:www-data storage
sudo chmod 775 storage
cd storage/
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;Or run the set-file-permissions.sh script (needs sudo):
sudo ./set-file-permissions.sh www-data ${USER} .Change hosts file so dev.taxidiotes points to localhost:
sudo nano /etc/hosts
127.0.0.1 dev.taxidiotes
The directories under resources/audio/fx and resources/audio/music should contain audio (.mp3) files that are not checked in source control, because of copyright issues.
Please check resources/audio/fx/README.md and resources/audio/music/README.md , in order to see which files you should download and put there.
In order to upload the files in a remote environment (staging or production server, for example), you can use scp:
scp -r -P 1337 /path/to/local/fx/* project_taxidiotes@server:/home/project_taxidiotes/www/resources/audio/fx
scp -r -P 1337 /path/to/local/music/* project_taxidiotes@server:/home/project_taxidiotes/www/resources/audio/music- Install and configure Xdebug on your machine
- At Chrome install Xdebug helper
- At PhpStorm/IntelliJ click the "Start listening for PHP debug connections"
- Send us a pull request describing your improvements/fixes/features