cviv

cviv

Member Since 2 Years Ago

Experience Points
13,870
Total
Experience

1,130 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
40
Lessons
Completed
Best Reply Awards
12
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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 3
13,870 XP
Jun
24
3 months ago
Activity icon

Replied to Salihawa

How did you install the package? Did you follow the procedures here

Activity icon

Replied to Error: Is Not A Function

How about

 $(document).on('click', '#save', function(){
        var post=  $('#editor').trumbowyg('html');
                $.ajax({
                    method: 'POST',
                    url: '/user/documents/{{$document->id}}/edit',
                    data: {
                        created_post: post
                    },
                    success: function(response){ 
                        console.log(response);
                    },
                    error: function(jqXHR, textStatus, errorThrown){ 
                        console.log(JSON.stringify(jqXHR));
                        console.log("AJAX error: " + textStatus + + ' : ' + errorThrown);
                    }
                });
            })
Jun
23
4 months ago
Activity icon

Replied to Update Stock

$message= array();//place outside the loop
if($product->quantity - $item->qty<0);
$message[] = 'Not enough Product' . $item->id;
else
$product->update(['quantity' => $product->quantity - $item->qty]);

then return $message to your view

Activity icon

Replied to GroupBy Not Working

try this

$books= Books::orderBy('Year')
    ->get()
    ->groupBy(function ($val) {
        return Carbon::parse($val->Year)->format('Y');
    });
Activity icon

Replied to Error: Is Not A Function

did you try removing the quote on created_post?

Activity icon

Replied to Update Stock

you cannot return a redirect because you are in a loop. I guess you need to put your message in an array like: Product A added successfully, Product B failed, insufficent quantity

Activity icon

Replied to Update Stock

my bad. sorry, you must implement it here

if($product->quantity - $item->qty<0);
do you logic here
else
$product->update(['quantity' => $product->quantity - $item->qty]);
Activity icon

Replied to Update Stock

there is an error in your implementation, how do you check out your product? one at a time or by bulk quantity?

Activity icon

Replied to Update Stock

my suggestion is posted in the code

public function checkout(){



        if(Request::isMethod('post')){
            $product_id = Request::get('product_id');
            $product = Product::find($product_id);
            Cart::add(array('id' => $product_id, 'name' => $product->name, 'qty' => 1, 'price' => $product->price));
        }
        $cart = Cart::content();
        //increment
        if (Request::get('product_id') && (Request::get('increment')) == 1) //this can be if(Request::get('increment')) == 1)  < is it possible to submit a POST request without a product id? If so, please check your front-end logic> 
 {
            $item = Cart::search(
                function($key, $value) {
                    return $key->id == Request::get('product_id');
                })->first();
            Cart::update($item->rowId, $item->qty += 1); //you can also have Cart::update($item->rowId, 'increment'); and do your logic in update method
        }
        if  (Request::get('decrease')) == 1) //check first if $item->qty >0. you might disable your button if quantity is 0
{
            $item = Cart::search(function($key, $value) { return $key->id == Request::get('product_id'); })->first();
            Cart::update($item->rowId, $item->qty -= 1); //

        }
Activity icon

Replied to Inquiry

you might want to check your browser settings.

Activity icon

Replied to Bug When I Manually Login Users

@chron If you login, this will be handled by App\Http\Controllers\Auth\LoginController.php and if you noticed there isprotected $redirectTo = '/dashboard'; This redirects you to your dashboard after logging in. But if you are already logged in, and tried to go to the log in page, this will be handled by, App\Http\Middleware\RedirectIfAuthenticated

you must change this return redirect('/home'); to the route you desired.

Activity icon

Replied to Bug When I Manually Login Users

@chron AFAIK if you get redirected to /home then you are authenticated/logged in.