lundi 18 juin 2018

Laravel Eloquent can increment ($collection->increment('field')) fail?

I have a redirect function that looks like this. For some reason, it looks like it's sometimes missing to increment the item. I'm wondering if it sometimes can be so that it misses this because some caching or something?

public function redirect($key)
{
    $item = $this->item->findOrFail($key);

    $item->increment('redirects');

    $encode = urlencode($item->_url);

    return view('item.redirect', ['url' => ($encode)]);
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2JZYd9O
via IFTTT

Aucun commentaire:

Enregistrer un commentaire