Tips

Generate IDE Helper - Code Hints

Because Laravel uses facaceds, we need to generate code hints so the IDE works properly

1
2
cd /var/www/vhosts/www.projects2staging.ec.developmagento.co.uk
php artisan ide-helper:generate

Get Current Logged In User

1
2
# required the IDE helper for completion to work
\Auth::user()

Adding a new Route

see: https://laravel.com/docs/5.4/routing

Need to edit routes/web.php

For example

1
 Route::get('tasks/createextension', 'TaskController@createExtension', [])->name('tasks.createExtension');
Can be broken down as
1
 Route::get('URI', 'CONTROLLER@METHOD', [])->name('NAME FOR LINK HELPER');

Finding your routes - by name/url

From the project route, run:

1
php artisan route:list | grep routename

PDF Broken - missing WKHTMLTOPDF dependency

Run the shellscript to install WKHTMLTOPDF:

1
2
cd /var/www/vhosts/www.projects2staging.ec.developmagento.co.uk
bash shellscripts/install_wkhtmltopdf.bash

npm run watch - event error

Your host machine has a file watch count that is not set or not set high enough. On your host machine, run:

1
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p