Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel eloquent tricks

// you can increase using
$post = Post::find($id);
$post->increment('views');

// or you can decrease using
$post = Post::find($id);
$post->decrement('views');
Source by laravelproject.com #
 
PREVIOUS NEXT
Tagged: #Laravel #eloquent #tricks
ADD COMMENT
Topic
Name
7+5 =