Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

例えばフィールドの値よりも、入力値が大きい場合はエラーをだすなど、 validatorでextendを使うとルールを拡張できる $valueは入力値。returnでfalseになるとエラーとして返される。 Validator::extend('pointcheck', function($attribute, $value, $parameters, $validator){ $user = Auth::user(); return TotalPoint::where('user_id',$user->id)->where('give_point','>=',$value)->exists(); }); $rules = [ 'point' => 'required|integer|min:1|pointcheck', ]; $messages = [ 'point.pointcheck'
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く