SHAIK

SHAIK

Member Since 2 Weeks Ago

Experience Points
230
Total
Experience

4,770 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
230 XP
Sep
08
2 weeks ago
Activity icon

Replied to Adding Quantity In Same Row

@automica

i think i need to create public function update request in this, can you help me with this update method.

Activity icon

Replied to Adding Quantity In Same Row

@automica

no single row also not getting with this.

Activity icon

Replied to Adding Quantity In Same Row

@automica

firstOrNew is not working with fresh bill.

Activity icon

Replied to Adding Quantity In Same Row

@automica

I tried with this but not working.

Activity icon

Replied to Adding Quantity In Same Row

@automica Hi Sir,

When I am using below code for billing iam getting duplicate rows of same item actually i wan to increase qty in billing page not duplicate rows

$saleDetail = new SaleDetail();
$saleDetail->sale_id = $sale_id;
$saleDetail->menu_id = $menu->id;
$saleDetail->menu_name = $menu->name;
$saleDetail->menu_price = $menu->price;
$saleDetail->quantity += $request->quantity;

$saleDetail->save();

Thanks for having look into this.

Sep
07
2 weeks ago
Activity icon

Replied to Adding Quantity In Same Row

// if there is no sale for the selected table, create a new sale record

    $public function orderFood(Request $request){
    $menu = Menu::find($request->menu_id);
    $table_id = $request->table_id;
    $table_name = $request->table_name;
    $sale = Sale::where('table_id', $table_id)->where('sale_status','unpaid')->first();
    // if there is no sale for the selected table, create a new sale record
    if(!$sale){
        $user = Auth::user();
        $sale = new Sale();
        $sale->table_id = $table_id;
        $sale->table_name = $table_name;
        $sale->user_id = $user->id;
        $sale->user_name = $user->name;
        $sale->save();
        $sale_id = $sale->id;
        // update table status
        $table = Table::find($table_id);
        $table->status = "unavailable";
        $table->save();
    }else{ // if there is a sale on the selected table
        $sale_id = $sale->id;
    }

    // add ordered menu to the sale_details table
    $saleDetail = new SaleDetail();
    $saleDetail->sale_id = $sale_id;
    $saleDetail->menu_id = $menu->id;
    $saleDetail->menu_name = $menu->name;
    $saleDetail->menu_price = $menu->price;
    $saleDetail->quantity += $request->quantity;
    
    $saleDetail->save();

    //update total price in the sales table
    $sale->total_price = $sale->total_price + ($request->quantity * $menu->price);
    $sale->save();


    $html = $this->getSaleDetails($sale_id);
    return $html; //testing
Activity icon

Started a new Conversation Adding Quantity In Same Row

How can i add same product two times by clicking item in same row. In this code after getting in new bill item is not reflecting in order menu

   $user = Auth::user();
    $sale = new Sale();
    $sale->table_id = $table_id;
    $sale->table_name = $table_name;
    $sale->user_id = $user->id;
    $sale->user_name = $user->name;
    $sale->save();
    $sale_id = $sale->id;
    // update table status
    $table = Table::find($table_id);
    $table->status = "unavailable";
    $table->save();
}else{ // if there is a sale on the selected table
    $sale_id = $sale->id;
}

// add ordered menu to the sale_details table
$saleDetail = SaleDetail::firstOrNew(
    ['sale_id' => $sale_id, 'menu_id' => $menu->id],
    ['quantity' => 0]
);

$saleDetail->sale_id = $sale_id;
$saleDetail->menu_id = $menu->id;
$saleDetail->menu_name = $menu->name;
$saleDetail->menu_price = $menu->price;
$saleDetail->quantity += ($request->quantity);
$saleDetail->save();
Activity icon

Replied to Add Qty On Order Menu

Thank a lot for having look into this but after completing first bill for next bill it not adding.

        $user = Auth::user();
        $sale = new Sale();
        $sale->table_id = $table_id;
        $sale->table_name = $table_name;
        $sale->user_id = $user->id;
        $sale->user_name = $user->name;
        $sale->save();
        $sale_id = $sale->id;
        // update table status
        $table = Table::find($table_id);
        $table->status = "unavailable";
        $table->save();
    }else{ // if there is a sale on the selected table
        $sale_id = $sale->id;
    }

    // add ordered menu to the sale_details table
    $saleDetail = SaleDetail::firstOrNew(
        ['sale_id' => $sale_id, 'menu_id' => $menu->id],
        ['quantity' => 0]
    );
    
    $saleDetail->sale_id = $sale_id;
    $saleDetail->menu_id = $menu->id;
    $saleDetail->menu_name = $menu->name;
    $saleDetail->menu_price = $menu->price;
    $saleDetail->quantity += ($request->quantity);
    $saleDetail->save();
Activity icon

Started a new Conversation Add Quantity On Order Menu

on clicking item it adds one qty by default and when i click on same item its adding another line instead of increasing qty below is my code can any one help me in this.

    // if there is no sale for the selected table, create a new sale record
    if(!$sale){
        $user = Auth::user();
        $sale = new Sale();
        $sale->table_id = $table_id;
        $sale->table_name = $table_name;
        $sale->user_id = $user->id;
        $sale->user_name = $user->name;
        $sale->save();
        $sale_id = $sale->id;
        // update table status
        $table = Table::find($table_id);
        $table->status = "unavailable";
        $table->save();
   else{ // if there is a sale on the selected table
        $sale_id = $sale->id;
    

    // add ordered menu to the sale_details table
    $saleDetail = new SaleDetail();
    $saleDetail->sale_id = $sale_id;
    $saleDetail->menu_id = $menu->id;
    $saleDetail->menu_name = $menu->name;
    $saleDetail->menu_price = $menu->price;
    $saleDetail->quantity = ($request->quantity);
    $saleDetail->save();
    //update total price in the sales table
    $sale->total_price = $sale->total_price + ($request->quantity * $menu->price);
    $sale->save();
Activity icon

Started a new Conversation Add Qty On Order Menu

on clicking item it adds one qty by default and when i click on same item its adding another line instead of increasing qty below is my code can any one help me in this. ( add ordered menu to the sale_details table ) $saleDetail = new SaleDetail(); $saleDetail->sale_id = $sale_id; $saleDetail->menu_id = $menu->id; $saleDetail->menu_name = $menu->name; $saleDetail->menu_price = $menu->price; $saleDetail->quantity = ($request->quantity); $saleDetail->save();