If i want function in controller work every 30 seconds for 5 minutes when i call this function what should use to do it?

|
hassanndadir 2022-06-12 11:31:17
seniormonsieur 2022-06-12 11:27:09
Was the model name?

yes

seniormonsieur 2022-06-12 11:32:00
hassanndadir 2022-06-12 11:31:17
yes

Ok good work

Yousef Dhrooj 2022-06-12 11:56:01
Hi
If i want function in controller work every 30 seconds for 5 minutes when i call this function what should use to do it?
seniormonsieur 2022-06-12 11:57:15
Yousef Dhrooj 2022-06-12 11:56:01
Hi
If i want function in controller work every 30 seconds for 5 minutes when i call this function what should use to do it?

Please elaborate better

Yousef Dhrooj 2022-06-12 12:02:51
seniormonsieur 2022-06-12 11:57:15
Please elaborate better

i want when call function work in background every 30 seconds for 5 minutes

seniormonsieur 2022-06-12 12:03:27
Yousef Dhrooj 2022-06-12 12:02:51
i want when call function work in background every 30 seconds for 5 minutes

Then stop?

Yousef Dhrooj 2022-06-12 12:03:35
yes
seniormonsieur 2022-06-12 12:04:15
Do you have a syntax of the problem or you want one
Yousef Dhrooj 2022-06-12 12:05:25
i just want advice if i can use thread or there something better
Waxikevin 2022-06-12 12:06:21
Yousef Dhrooj 2022-06-12 11:56:01
Hi
If i want function in controller work every 30 seconds for 5 minutes when i call this function what should use to do it?

Have you looked at scheduler in laravel

Yousef Dhrooj 2022-06-12 12:07:18
Waxikevin 2022-06-12 12:06:21
Have you looked at scheduler in laravel

no

Yousef Dhrooj 2022-06-12 12:08:28
Waxikevin 2022-06-12 12:06:21
Have you looked at scheduler in laravel

i will search about it thank you

Waxikevin 2022-06-12 12:09:06
Then have a look ..probably you will find more insights and configure it to your applications demands
zey34354 2022-06-12 12:09:38
seniormonsieur 2022-06-12 11:06:57
public function show($id)
{
$data= User::find($id);
$roles= Comment::all();
return view(‘admin.comment.show’,compact(‘data’,’roles’)

);
}

why did you delete role
it has a relationship with it

seniormonsieur 2022-06-12 12:09:47
Yousef Dhrooj 2022-06-12 12:08:28
i will search about it thank you

Please your idea works let us and tell us in more depth what you mean and how it works

seniormonsieur 2022-06-12 12:10:14
zey34354 2022-06-12 12:09:38
why did you delete role
it has a relationship with it

They are better ways to call the relationship

seniormonsieur 2022-06-12 12:10:25
And I didnt understand the relationship
seniormonsieur 2022-06-12 12:10:35
zey34354 2022-06-12 12:09:38
why did you delete role
it has a relationship with it

But did it work?

zey34354 2022-06-12 12:11:44
seniormonsieur 2022-06-12 12:10:35
But did it work?

no

zey34354 2022-06-12 12:12:00
without relationship it cant work
seniormonsieur 2022-06-12 12:12:07
zey34354 2022-06-12 12:12:00
without relationship it cant work

Hmm

seniormonsieur 2022-06-12 12:13:01
The relationship is inside the user or role?
seniormonsieur 2022-06-12 12:13:15
Or non
zey34354 2022-06-12 12:15:11
seniormonsieur 2022-06-12 12:13:01
The relationship is inside the user or role?

laravel_discuss-125156.jpg

zey34354 2022-06-12 12:15:55
seniormonsieur 2022-06-12 12:13:01
The relationship is inside the user or role?

class Role extends Model
{
use HasFactory;

// I have to make sure about this
public function users()
{
return $this->belongsToMany(User::class, ‘role_users’);
}

}

Yousef Dhrooj 2022-06-12 12:15:59
seniormonsieur 2022-06-12 12:09:47
Please your idea works let us and tell us in more depth what you mean and how it works

i build app taxi now i reach to function which customer search for driver,what i want if this function didn’t find driver still search in background for 5 minute

zey34354 2022-06-12 12:16:14
public function reviews()
{
return $this->hasMany(Comment::class);

}

public function roles()
{
return $this->belongsToMany(Role::class,’role_users’);
}

seniormonsieur 2022-06-12 12:17:09
Yousef Dhrooj 2022-06-12 12:15:59
i build app taxi now i reach to function which customer search for driver,what i want if this function didn’t find driver still search in background for 5 minute

Ooh so research every 5 seconds? For 5 minutes then after 5 minutes show no available driver?

Yousef Dhrooj 2022-06-12 12:17:25
seniormonsieur 2022-06-12 12:17:09
Ooh so research every 5 seconds? For 5 minutes then after 5 minutes show no available driver?

yes

seniormonsieur 2022-06-12 12:18:16
Yousef Dhrooj 2022-06-12 12:17:25
yes

Why not use loop for it like

V K 2022-06-12 12:18:45
laravel_discuss-125164.jpg
??!! Not work register
(Package auth breeze)
Yousef Dhrooj 2022-06-12 12:21:16
seniormonsieur 2022-06-12 12:18:16
Why not use loop for it like

it this right way ?

seniormonsieur 2022-06-12 12:21:33
Yousef Dhrooj 2022-06-12 12:21:16
it this right way ?

Not really but its an admin

seniormonsieur 2022-06-12 12:22:08
V K 2022-06-12 12:18:45
??!! Not work register
(Package auth breeze)

Check your register blade

seniormonsieur 2022-06-12 12:22:18
If method is post
|