Skip to content

Tips

Generate IDE Helper - Code Hints

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

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

Get Current Logged In User

# 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

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

Finding your routes - by name/url

From the project route, run:

php artisan route:list | grep routename

PDF Broken - missing WKHTMLTOPDF dependency

Run the shellscript to install WKHTMLTOPDF:

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:

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