I want to add extra parameter type in with condition. I have no type column in matches table. Expeacted Out put is: Answer If the value of “type” is static you can try something like this: Add this line (import) at the begging of the file: Then:
Tag: laravel
How to validate at least one checkbox is checked in a loop in Laravel?
I’m trying to validate my checkbox from a loop, where at least one is checked and displays an error/alert or disable the submit button instead if there is no checkbox checked. I tried putting a required method inside my checkbox, but the checkbox is in a loop that’s why it requires all to be checked. That’s why I tried the
How can we use when clause for multiple tables in laravel eloquent query?
I’m using condition based queries but i have a problem how can i use (when) with other table/model because i have to put condition based on the other table column (branch_id). branch_id comes from steps table. Answer You can make it like
Display all images one by one laravel
On the backend side, my pictures are loaded normally, but I have problems with displaying them on the front My Model I am trying to display all the images on the page like this My page.blade.php But I am getting an error: Undefined variable: $images I need to declare this variable with an array of pictures somewhere on the client
Issue with DocuSign sending Envelopes
I recently changed my DocuSign integration to use the JWT OAuth flow. To achieve this I have a few classes. OAuth Client Signature Client Service Then, in my constructors where I want to use it I’m doing Finally, I use it like so But I get an error that reads DocuSigneSignClientApiException: Error while requesting server, received a non successful HTTP
laravel relationship not loading
I’ve got a Product and a Category models: In my controller, I’m retrieveing all products and wanted to return the category object the product belongs to in the response, so I’m doing: and my resource looks like: but the response I’m getting is: I tried loading the relationship differently: but the result is the same. It seems that the relationship
How to show round figure number in php?
I have a variable called $totalResults which has dynamic values, depend on database entries. I need to show a limit like if $totalResults has 154 results then I want show that 154 out of 500. But I want it dynamically, like if the result cross 500, example the result value is 514, then it’ll show like 514 out of 1000.
Can’t insert data on my database from laravel
When I try to insert data into my database, Laravel does not insert the records, but it is strange because when I migrate the tables to be able to perform the database, Laravel creates them without any problem, I do not know what I can be doing wrong if the migration run but stored no Route: Controler: Template: Answer The
how to compare two separate relations fields with each other in whereHas laravel?
I use laravel 9 and I have 3 model here : order shop accepted_order notice : accepted_order is not pivot table Now I want to get accepted_orders where : or and both query orderBy created_at desc. how can I use whereHas query that compare two separate relations field with each other? thanks Answer I found it
laravel eloquent model record not fetched
I am facing a strange issue. When I do NumberConfiguration::all() I receive the following result: but in the database I have actually 2 record: I didnt find anything what can cause this problem, that not all record are represented by the eloquent model biding. I am using postgresql database. There is an observer in the parent class, but even if