Example #1
0
 public function updateContentById($id = 0, $data = array())
 {
     if (empty($id)) {
         return false;
     }
     if (empty($data)) {
         return false;
     }
     $content_model = new ContentModel();
     return $content_model->where('id', $id)->update($data);
 }
Example #2
0
 protected static function boot()
 {
     parent::boot();
     static::creating(function ($article) {
         if ($article['username'] == null) {
             $article['username'] = Auth::user()->username;
         }
     });
 }