Php – null value that should not exist
little by little but right now I have this error "Attempt to read property "name" on null" and in my database I have the information so that it has to appear in my view, please help my database data is…
little by little but right now I have this error "Attempt to read property "name" on null" and in my database I have the information so that it has to appear in my view, please help my database data is…
I am currently working on an ecommerce project in laravel 10. In the admin dashboard in my categories section, I have set two columns, one for category images and the other column for category banner images. My problem arises where…
I am a bit confused about laravel database connection. If I execute a laravel code that select from database three queries as example. If laravel establish database connection and login into database then logout for each executing query or laravel…
I'm working on an ecommerce project in Laravel 10.48.8, my PHP version is 8.2.12. I have used one to many relation to link the parent table categories to one of the child table products using foreign key in delete cascade.…
Soft deleted records are getting fetched from database. I have added soft delete to Category model. 'deleted_at' column is being set when I soft delete a record. But, when I fetch the result from database using Category::latest('id')->paginate(20) it is returning…
I attempted to integrate socket.io with Laravel, but was unsuccessful. I have been unable to find comprehensive documentation to facilitate this integration. I followed some documentation from Laracasts, but it appears to be outdated and did not resolve my issue.…
I have deployed Laravel 10 to Siteground. I placed the contents of Laravel's public folder directly inside public_html, and created a separate folder within public_html for the rest of Laravel's directory structure. As a result, the storage folder (which is…
Is there a way in newer laravel versions to cache many things with a certain prefix and then get all by doing Cache::get('prefix_*) or something ? I'm trying to cache the Online Users for like 5 minutes and I want…
I'm on Laravel 10, and new to it too. I did a simple query like this Sample::where( [ ['query_string', '=' , $string], ['from', '=', 'usa'], ['status_id', '=', '1'], ['created_at', '>', 'NOW() - INTERVAL 7 DAY'] ] )->toSql(); which generates a…
I have a Laravel project set up on my MacBook and I'm encountering an issue with connecting to the database when using PHP artisan serve. Here's the problem: When I access the project via localhost/project_name/public, everything works fine, and database…