Skip to content

Tag: laravel-8

Attempt to read property “permissions” on null in Laravel 8

I am trying to register a user to the system and assign the patient role by default. The problem arises in the RegisterController controller. In the create () method I write the following code: The error that laravel 8 throws is the following: Attempt to read property “permissions” on null It is n…

How can I write this query with Eloquent

Let’s say I have a method like this: My question is, how can I rewrite this query with Eloquent for my Laravel project? Answer From what I understood I think this is what you are looking for, try it and tell me: You can get more information from the laravel Database documentation Query Builder here: htt…

How to automatically number each row in a table in laravel?

Please I want to automatically number each row when data is displayed from the database. Something like this so each row is numbered in ascending order from 1 to n depending on the data available in the database. How do I properly do that. Any Help please am new in laravel Answer If you are using blade, the l…