score:0
According to you SQL query which you provided in your question comment here is the solution with Laravel Model:-
# this query will find your Gold item with there provided where conditions.
# you can pass more where conditions as per your requirements.
$gold = Gold::where('type', '=', $request->input('type'))
->where('parent_id', '=', $request->input('parent_id'))->first();
if(!$gold) {
return throw Exception('Invalid Gold Item', 422);
}
$gold->comment = $request->input('comment');
$gold->userid = $request->input('userid');
$gold->save();
Here is the solution as per your requirement which I understand.
More Answer
- want to find with two request values
- Chrome CORS request sending two cookies with the same name
- Laravel Form Request Validation rule "required" not working with null values
- How to have conditions for two values with laravel eloquent `when` instead of if-elseif
- I want create dummy data with two dimensional array of objects in php7
- I want to send two email with different view page using Laravel
- Get old or user variable value on form after custom request validation error, view with two different forms
- Laravel Request Macro With Static Values
- After form sent, values from select inputs are stored in request variable with an extra ' " '
- How to Find and Replace Multiple Values in a String with PHP
- How can I redirect my form with the sum of two values and show it in a readonly input field in Laravel?
- How to split an array into two with considering values
- How to find duplicate values in database with Laravel
- want to get difference between two values
- How to compare two arrays in Laravel populate select list with matched and unmatched values
- Laravel : How group by with select two column have deferent values
- How can you use Eloquent to find related values two tables away and in a different database?
- I want to join two table with query builder in laravel
- How do I show all dataset but with a condition that two values at the same time don't appear?
- when i send data with ajax(jquery) i don't find the values in controller without form in laravel 5.1
- Laravel 7: Find days and dates between two dates with condition
- i have a variable which i want to share its values with all my controllers - Laravel
- I want to retrieve with an element that is between two given dates according to the current date
- Problem with float values in json. The values are interpreted with two elements of the array
- Hot to find values of related tables from a pivot table in resources with Laravel
- I have got two associative arrays of different lengths. I want to know how to compare values and apply to checkboxes?
- calculate values from two form input and output to another form input while there are several inputs with the same IDs
- Facing issues while using two or more request with GuzzleHttp in laravel
- Laravel eloquent finding entry pairs with two destinct values
- I am using yajra datatables package laravel 5.1. I have sent some from controller to view page, Now i want to search with two fields. How to do that?
More answer with same ag
- Why use 'php://input' over the POST superglobal - Stripe SCA example
- Laravel 5 Validation Trim
- I don't understand how works function (Builder $query) in Laravel
- sql (errno 150 "Foreign key constraint is incorrectly formed")
- Cannot test laravel livewire model hidden attribute with assertSet
- Laravel / MySQL Error: SQLSTATE[HY000]: General error: 1835 Malformed communication packet
- Best way to transfer data from one database to another
- Laravel default .htaccess file will not work
- How to map urls like urls 'day and name' in Laravel?
- Handle arrays in laravel
- How do I save textarea content in laravel on shared hosting?
- Lumen base url is different in a Controller and a Job
- Mariadb case insensitive fulltext search on json columns
- Laravel get value of column from relation through pivot on load() after all()
- Validator Does Not Show Errors At Blade
- Update/replace value with new values inputted in laravel 4.2
- Callback function of with() returns empty collection
- Eloquent filter relationship records
- Laravel 5 model relationship many to many
- Lavary laravel menu not working
- Transferring form input to another page through variable in laravel
- Laravel loop on model and change to array
- How to fetch Array from .json in PHP
- return a $post with related user model after update in Laravel
- Unable to fetch data from curl request in my express app?
- Forge/DigitalOcean - This site canβt be reached
- How to put plural parameters into url with laravel
- Undefined property: Illuminate\Database\Eloquent\Builder::$[{"id":22,"title"
- How to gather value(s) from check-boxes, and sync that value to a pivot table?
- Apache is not respecting my default permissions when writing files
Source:
stackoverflow.com