Skip to content
Advertisement

Tag: laravel

Laravel controller shows syntax error, unexpected variable “$user”, expecting “function” or “const”

I am creating a forgot password feature in my application and when creating my controller, I used this code: But the first line gives an syntax error, unexpected variable “$user”, expecting “function” or “const” error. Does anyone know what I am doing wrong? Answer Make Sure Your { } are correct..and the code inside a function,check ; are correct

Laravel : Upload 64base image instead of normal

I have an application using React and Laravel where I’m uploading images. I’m using Laravel Image Intervention package. When testing my API, the upload for a normal image works perfectly. Using React, the user can select an image from his pc and crop it, then he sees the preview as a generated cropped 64base image. I would want to upload

How to override Laravel default routes with my package

I have developed a package and published it to packagist. My package contains a service provider and a set of routes including default ‘/’ route which are loaded through service provider class’ boot method. However, instead of default route from package the default route from web.php gets executed whenever I visit the site. Also other routes from the package seem

Laravel 8 custom headers run only for home page

I want to add custom headers for every response from my Laravel project. I created a middleware using php artisan make:middleware customheaders then I used this code in customheaders middleware then I added my class to kernel Now if I run my application home page localhost:8000 I can see my custom headers but if I go to any other page

Advertisement