eloquent - Laravel 5 : Incrementing by 2 instead by 1 -


i have field named viewed represents count of page displayed.

in controller have method :

public function getmedia($slug) {     $media = media::where('slug', $slug)->first();     $media->viewed += 1;     $media->save();      return view('medias.view', compact('media')); } 

the problem page incremented 2 instead one. strange thing when have 49 displayed in database there 50..

thanx help


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -