Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

insert views laravel database

//for profile
  function profile($id){ 
     $data['user'] = User::find($id);
     #insert view                   
     User::find($id)->increment('views',1);
    
  return view('/user/profile', $data);}
// end for profile
 
PREVIOUS NEXT
Tagged: #insert #views #laravel #database
ADD COMMENT
Topic
Name
4+4 =