Laravel 10 Web Application for Creating content for the Talk & Play application
-
Make sure PHP 8.1 (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 migrate
to create the DB schema andphp artisan db:seed
in order to insert the starter data to the DB -
Install laravel/back-end dependencies
composer install
- Front-end dependencies
It is very easy to install multiple versions of NodeJS and npm, by using Node Version Manager (nvm).
If you are using nvm
, run this command in order to sync to the correct NodeJS version for the project:
nvm use
Then, install and compile the front-end dependencies:
npm install
npm run dev
- Create the symbolic link for user-uploaded files.
php artisan storage:link
in order to link the /public/storage
folder with the /storage/app/public
directory.
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
* * * * * cd /home/project_talkandplay/www/talkandplay.scify.org/ && php artisan schedule:run >> /dev/null 2>&1
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:
This 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/tnpmarketplace.conf
% sudo nano /etc/apache2/sites-available/tnpmarketplace.conf
<VirtualHost *:80>
ServerName dev.tnpmarketplace
ServerAlias dev.tnpmarketplace
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/tnpmarketplace.conf
Enable mod_rewrite, mod_ssl and restart apache:
% sudo a2enmod rewrite && sudo a2enmod ssl && sudo service apache2 restart
Fix permissions for storage directory:
sudo chown -R user:www-data storage
chmod 775 storage
cd storage/
find . -type f -exec chmod 664 {} \;
find . -type d -exec chmod 775 {} \;
Or run the set-file-permissions.sh
script.
Change hosts file so dev.tnpmarketplace points to to localhost
sudo nano /etc/hosts
127.0.0.1 dev.tnpmarketplace
- Install and configure Xdebug on your machine
- At Chrome install Xdebug helper
- At PhpStorm/IntelliJ click the "Start listening for PHP debug connections"