Support the ongoing development of Laravel.io →
Requests Laravel Database
Last updated 2 years ago.
0

Maybe you should try and make your question a bit more concise?

0
Solution

here is solution

$referal_user = $request->ref;
    $referal_email = DB::table('admins')->where('mobile', $referal_user)->first();
    $referal_id = $referal_email->id;
    $right_count = $referal_email->no_user_right;
    $list_all_right_user = $referal_email->user_listing_right;
    $ref = $request->ref;
    $mobile = $request->mobile;
    $user_listing_left = $referal_email->user_listing_left;
    while( $refUser = Admin::where('mobile', $ref)->first() )
    {
        $refUser->user_left = $request->email;
        $refUser->user_listing_left = $refUser->user_listing_left . "," .$request->email;
        $refUser->save();

        // Update $ref to find the next guy
        $ref = $refUser->ref;

    }
0

Sign in to participate in this thread!

Eventy

Your banner here too?

kobid kobid Joined 31 Aug 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.