The ultimate Laravel debug guide

Whenever I got a Laravel project to do some front-end work on it, I always had some issues during installation or had to configure it further. This is a guide to fix some common issues.

2021-09-16

Laravel install guide from zero

  • composer global require laravel/installer
  • composer install
  • create .env file and set up DB in phpMyAdmin if needed
  • php artisan key:generate
  • composer update

Start dev environment:

  • sudo /opt/lampp/lampp start | or start GUI in windows
  • php artisan serve
  • npm run watch
  • check http://localhost:3000

linux specific install debug instructions

install composer package from package manager

  • if you're having isuues while composer install
    • gd extension is missing
      • php --ini to check php config location
        • edit /etc/php/php.ini
        • enable extensions by uncommenting them
        • extension=gd
        • extension=iconv
    • install php-gd module from package manager if still not found

php artisan key:generate

  • could not find drive
    • uncomment pdo_mysql extension in the php.ini
    • or database missing, check .env file

Problems with xampp

follow this guide: https://linux4one.com/how-to-install-xampp-on-manjaro-18

No Livereload, sourcemap, assets missing

add to webpack.mix.js:

mix.sourceMaps() .webpackConfig({ devtool:'source-map' }) .sass('resources/sass/main.scss', 'public/css') .js('resources/js/app.js', 'public/js') .copy('resources/images/*.png', 'public/images') .copy('resources/images/*.jpg', 'public/images') .copy('resources/svg/*.svg', 'public/svg') .browserSync('http://localhost:8000');

 

This site is using Google Analitics Privacy Policy and Terms of Service.