Already solved sir?

|
udev21 2022-03-01 15:43:31
etekumoses 2022-03-01 15:37:06
hey guys is it possible to move data once it has reached some condition for example i want to move the ‘candidate’ when the votes is >= 2 votes to another table so once two people have voted i move it to the example “cleantable”. Someone kindly help

use triggers

Amit Sharma 2022-03-01 15:47:19
anyone pls help me
Amit Sharma 2022-03-01 15:47:32
$(‘body’).on(‘click’, ‘.editUser’, function () {
var user_id = $(this).data(‘id’);
$.get(“{{ route(‘users.edit’) }}” +’/’ + user_id, function (data) {
$(‘#modelHeading’).html(“Edit User Detail”);
$(‘#saveBtn’).val(“edit-user”);
Amit Sharma 2022-03-01 15:47:42
Route::get(‘users/{id}’, [UserController::class, ‘edit’])->name(‘users.edit’);
Amit Sharma 2022-03-01 15:48:38
but it shows Missing required parameter for [Route: users.edit] [URI: users/{id}] [Missing parameter: id]
Amit Sharma 2022-03-01 15:49:02
pls help what i am give wrong their
surajjdhv 2022-03-01 15:49:27
You’ll have to pass the parameter as route argument
surajjdhv 2022-03-01 15:49:43
But in your case you can pass # for example
surajjdhv 2022-03-01 15:49:55
And replace it with the user id
surajjdhv 2022-03-01 15:50:11
In javascript
Amit Sharma 2022-03-01 15:51:24
can you pls explain it with same code
Amit Sharma 2022-03-01 15:51:43
pls
Noob Developer 2022-03-01 16:29:10
Can someone help me how to check role in search
Noob Developer 2022-03-01 16:29:39
It’s could OK but role not get
Devajayantha 2022-03-01 16:31:15
Noob Developer 2022-03-01 16:29:39
It’s could OK but role not get

Can u dd($data->role) before if condition?

Noob Developer 2022-03-01 16:32:54
Ok
Noob Developer 2022-03-01 16:35:41
Devajayantha 2022-03-01 16:31:15
Can u dd($data->role) before if condition?

Don’t give value

Ojsholly 2022-03-01 16:42:01
Noob Developer 2022-03-01 16:29:10
Can someone help me how to check role in search

Use Eloquent local scopes to query for records where the role is not 1

Amit Sharma 2022-03-01 16:43:31
anyone pls help
Amit Sharma 2022-03-01 16:43:50
$(‘body’).on(‘click’, ‘.editUser’, function () {
var id = $(this).data(‘id’);
$.get(“{{ route(‘users.edit’) }}” +’/’ + id, function (data) {
$(‘#modelHeading’).html(“Edit User Detail”);
$(‘#saveBtn’).val(“edit-user”);
$(‘#ajaxModel’).modal(‘show’);
$(‘#id’).val(data.id);
$(‘#name’).val(data.name);
Amit Sharma 2022-03-01 16:44:01
Route::get(‘users/{id}’, [UserController::class, ‘edit’])->name(‘users.edit’);
Amit Sharma 2022-03-01 16:44:30
Missing required parameter for [Route: users.edit] [URI: users/{id}] [Missing parameter: id]. (View:
Siberfx 2022-03-01 16:44:48
you cant pass id with javascript like that
Amit Sharma 2022-03-01 16:45:38
how to pass pls suggest
Ojsholly 2022-03-01 16:45:58
Siberfx 2022-03-01 16:44:48
you cant pass id with javascript like that

You actually can

Ojsholly 2022-03-01 16:46:09
https://w3codegenerator.com/code-snippets/jquery/how-to-pass-javascript-variable-to-laravel-route-on-ajax-call#:~:text=You%20can%20pass%20javascript%20variable,url%20parameters%20of%20ajax%20method.

How to pass javascript variable to laravel route on ajax call – W3codegeneratorW3Codegenerator
You can pass javascript variable value to laravel route on ajax call. You have to use a placeholder to generate the URL and after that replace value by using replace method
Ojsholly 2022-03-01 16:46:46
Ojsholly 2022-03-01 16:46:09
https://w3codegenerator.com/code-snippets/jquery/how-to-pass-javascript-variable-to-laravel-route-on-ajax-call#:~:text=You%20can%20pass%20javascript%20variable,url%20parameters%20of%20ajax%20method.

Amit

Siberfx 2022-03-01 16:51:25
but the route himself requires that parameter to generate the URL
Siberfx 2022-03-01 16:51:40
you can not pass it with javascriptinstead remove the parameter from route
Siberfx 2022-03-01 16:51:56
catch inside controller with request()->get(‘id’);
Amit Sharma 2022-03-01 16:51:58
var id = $(this).data(‘id’);
$.get(“{{ route(‘users.edit’, id) }}”, function (data) {
$(‘#modelHeading’).html(“Edit User Detail”);
Amit Sharma 2022-03-01 16:52:19
is it ok ?
Siberfx 2022-03-01 16:52:37
no.
Ojsholly 2022-03-01 16:52:45
Amit Sharma 2022-03-01 16:52:19
is it ok ?

Obviously not. Check the example again, character for character.

Devajayantha 2022-03-01 16:54:38
Noob Developer 2022-03-01 16:35:41
Don’t give value

Already solved sir?

|