Inheritance: extends Illuminate\Database\Eloquent\Model, use trait App\Traits\Validatable
コード例 #1
0
 public function voteFeature($topicId)
 {
     $star = FeatureVote::createNew(['user_id' => Auth::user()->user_id, 'topic_id' => $topicId]);
     if ($star->getKey() !== null) {
         return ujs_redirect(route('forum.topics.show', $topicId));
     } else {
         return error_popup(implode(' ', $star->validationErrors()->allMessages()));
     }
 }