I am creating an API in Laravel 8 (PHP 7.4) and I wanted to secure it. The choice fell on tymon / jwt-auth. I follow the documentation from the website: https://jwt-auth.readthedocs.io/en/develop/quick-start/ Everything works fine here. However, later when I create a route to login and want to get the token u…
Tag: laravel-8
Adding date and time to excel export in Laravel
I am new to Laravel and I am making a new project where I am exporting my schools data to a spreadsheet with maatwebsite, I have given it a title with the following code: What I want to accomplish is to have the date next to the title so it should be Staff Report-04/05/21 I tried to use date time
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 Sur…
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 ex…
How can I display data from another table only authenticate user [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I have two tables on my database named user and products. I can register by email in the user …
Laravel 8: Custom Middleware Does Not Seem To Be Working
I’m using Laravel 8 for my project and in this project and I have created a custom Middleware called Admin that goes like this: And I tried applying it like this: And on Kernel.php: So I called the isAdmin() at User Model which simply checks if the role of the user is correct or not: Currently, I have t…
Laravel 8.38 validation issue, max file size. RuntimeException: The file {public path} cannot be opened. in file Psr17Factory.php on line 46
Created the file validation as (for test purpose it is 5kb) There is a weird issue, as it is displaying a valid error on uploading png but on uploading mp4 it is throwing following error Answer Open icons tray on right side of your windows. left click on wamp icon. click on PHP > PHP Settings > upload_m…
Laravel 8: Call to a member function notify() on string
I’m working with Laravel 8 to make a forum and now I wanted to send a notification to a user who has asked a question whenever someone answered that question. So in order to do that, I added this to the Controller: So the $question is the question id and $asker is the user id of the person who has
my all value is not showing in view, what can i d [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed las…
illuminate vendors not found in PhpStorm since Laravel 8.36 upgrade
Since I’ve updated to Laravel 8.36 PhpStorm can’t autocomplete and doesn’t find the vendors… what’s the problem ?