I am on Laravel 7.24 and right now I have a blogs table, model and controller. I am making a call to /slug and am trying to save a blog post as a test using a mutator and the eloquent create(). The …
Tag: laravel
Laravel whereNull and where clause returns empty object
I’m new to laravel. I tried to fetch some records from my database which are “parent” column is “null”. But it returns always empty object. Then I got the query using toSql() …
Laravel 8 resource controller not fetching model
In Laravel 7 fetching a model was pretty straightforward, i just needed to setup mi resource route and make a get to the address: http://localhost/test/public/employee/1 But i cant make it work on Laravel 8, according to my understanding i just need to do this: But dd only returns an empty class: If i do this…
Can’t install “laravel-apidoc-generator” due to “Conclusion: remove doctrine/inflector 2.0.3”
I’m trying to install laravel-apidoc-generator (https://github.com/mpociot/laravel-apidoc-generator) in my latest Lumen REST API. This is my Lumen version: Lumen (8.0.1) (Laravel Components ^8.0) This …
Returning null instead of “Call to undefined relationship” error for Laravel relationships
When I use ModelName::with(‘somerelation’)->get() with Laravel Eloquent, if the model doesn’t have this relationship I get Call to undefined relationship [somerelation] on model [AppSomeModel] error. But for polymorphic relations, I get collection of all related models and I would like to…
Eloquent complex relationship for a chat message system in laravel
I am writing a chat system and I have the following tables: chat_conversations: id, name chat_messages: id, chat_conversation_id, message, deleted_at chat_message_user: id, chat_message_id, user_id, …
How to get two minimum values from a price column (database). [Laravel]
I’m doing an online store and I have a “sale” section. In this section I want to place two products with the minimum price. I can get one product using the min () function, but I do not understand how to get two minimum values from the database.Thank you in advance. Answer you can use it l…
append response vue JS into component table
i´m traying append my response vue into a table but i can´t and i don´t know why. i can get all my data from my database, i can show it en my web brower console but my table is empty. i attach my …
Switching to other field when the value is null using whereYear Laravel Query Builder
I have question with regard to switching on other field when the second field is null using whereYear. Say for example we have this database table +————+————+ | field_one | field_two …
Laravel mail will not receive by gmail users
When I send email by laravel non-gmail accounts will receive emails but Gmail accounts will not, does anyone here faced such problem before? any idea what causes that? As my emails are receiving with …