{"id":341,"date":"2018-03-02T00:44:58","date_gmt":"2018-03-01T15:44:58","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=341"},"modified":"2018-12-01T17:07:19","modified_gmt":"2018-12-01T08:07:19","slug":"%e5%85%a853%e7%a8%ae%e9%a1%9e%ef%bc%81laravel-5-6%e3%81%ae%e3%83%90%e3%83%aa%e3%83%87%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e5%ae%9f%e4%be%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=341","title":{"rendered":"\u516854\u7a2e\u985e\uff01Laravel 5.7\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5b9f\u4f8b"},"content":{"rendered":"<p>Laravel\u306b\u306f\u3044\u3064\u3082\u958b\u767a\u306e\u4f5c\u696d\u52b9\u7387\u3092\u3042\u3052\u3066\u3082\u3089\u3063\u3066\u3001\u3068\u3066\u3082\u611f\u8b1d\u3057\u3066\u3044\u308b\u3093\u3067\u3059\u3051\u3069\u3001\u305d\u306e\u4e2d\u3067\u3082\u30c8\u30c3\u30d7\u30af\u30e9\u30b9\u3067\u3042\u308a\u304c\u305f\u3044\u3068\u611f\u3058\u308b\u3082\u306e\u3001\u305d\u308c\u304c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p><strong>\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3068\u306f\u3001\u5165\u529b\u30c7\u30fc\u30bf\u304c\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u6a5f\u80fd<\/strong>\u306e\u3053\u3068\u3067\u3059\u3002\u4e00\u6614\u524d\u307e\u3067\u306f\u3001\u3072\u3068\u3064\u305a\u3064\u30e1\u30fc\u30eb\u306e\u59a5\u5f53\u6027\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306a\u3069\u3001\u3068\u3066\u3082\u5104\u52ab\u306a\u4f5c\u696d\u3067\u3057\u305f\u3002<\/p>\n<p>\u3067\u3082\u3001Laravel\u306b\u306f\u5f37\u529b\u306a\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u304c\u5099\u308f\u3063\u3066\u3044\u308b\u3093\u3067\u3001\u30b5\u30af\u30b5\u30af\u3068\u958b\u767a\u3092\u9032\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\uff01\u4eca\u56de\u306f\u3001\u305d\u3093\u306a\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5168\uff15\uff14\u7a2e\u985e\u3092Laravel <code>5.7<\/code>\u3067\u30c6\u30b9\u30c8\u5b9f\u884c\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\u305c\u3072\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n<h1>\u57fa\u672c\u30b3\u30fc\u30c9<\/h1>\n<p>\u672c\u6765\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u300cphp artisan make:request *****\u300d\u3067\u72ec\u81ea\u306eRequest\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u304c\u304a\u3059\u3059\u3081\u3067\u3059\uff08<a href=\"https:\/\/blog.capilano-fw.com\/?p=261\">\u5b8c\u5168\u306a\u624b\u9806\uff01Laravel\u3067Ajax\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u3064\u304f\u308b\u65b9\u6cd5<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\uff09\u3002<\/p>\n<p>\u305f\u3060\u3001\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>$input = ['name' =&gt; 'value'];<\/strong>\r\n<strong>$rules = ['name' =&gt; '*****'];<\/strong>\r\n<strong>$validator = Validator::make($input, $rules);<\/strong>\r\n\r\n<strong>if($validator-&gt;fails()) {<\/strong>\r\n\r\n<strong>    echo '\u5931\u6557!';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u4e2d\u8eab\u3068\u3057\u3066\u306f\u3001<\/p>\n<ul>\n<li><strong>$input<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u5165\u529b\u30c7\u30fc\u30bf\uff08\u3053\u3053\u306e\u30c7\u30fc\u30bf\u304c\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\uff09<\/li>\n<li><strong>$rules<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb<\/li>\n<\/ul>\n<p>\u305d\u3057\u3066\u3001\u3082\u3057\u5165\u529b\u30c7\u30fc\u30bf\u304c\u6b63\u3057\u304f\u306a\u3044\u5834\u5408\u306f\u300c\u5931\u6557\uff01\u300d\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3067\u306f\u3001\u3055\u3063\u305d\u304f\u3072\u3068\u3064\u3072\u3068\u3064\u307f\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<h1>accepted<\/h1>\n<p>\u3053\u308c\u306f\u3001\u3088\u304f\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u306e\u3068\u304d\u3001\u300c\u5229\u7528\u898f\u7d04\u306b\u540c\u610f\u3059\u308b\u300d\u306b\u30c1\u30a7\u30c3\u30af\u304c\u5165\u3063\u3066\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<pre>&lt;input name=\"kiyaku\" type=\"checkbox\" value=\"1\" \/&gt;\u5229\u7528\u898f\u7d04\u306b\u540c\u610f\u3059\u308b<\/pre>\n<p>\u3053\u3053\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u306e\u306f\u3001<strong>value<\/strong>\u306e\u4e2d\u8eab\u3067\u3059\u3002<br \/>\n\u30c1\u30a7\u30c3\u30af\u3092\u901a\u904e\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\uff14\u3064\u306e\u3046\u3061\u306e\u3069\u308c\u304b\u3067\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<ul>\n<li><strong>yes<\/strong><\/li>\n<li><strong>on<\/strong><\/li>\n<li><strong>true<\/strong><\/li>\n<li><strong>1<\/strong><\/li>\n<\/ul>\n<p>\u79c1\u306e\u5834\u5408\u306f\u3001\u898b\u305f\u76ee\u304c\u30b7\u30f3\u30d7\u30eb\u306a\u306e\u3067\u300c\uff11\u300d\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3001\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre><strong>$input = ['kiyaku' =&gt; 1];  \/\/ \u6210\u529f\u3057\u307e\u3059<\/strong>\r\n<strong>$rules = ['kiyaku' =&gt; 'accepted'];<\/strong><\/pre>\n<h1>after\uff0fbefore\uff0fafter_or_equal\uff0fbefore_or_equal<\/h1>\n<p>\u65e5\u4ed8\u304c\u6b63\u3057\u3044\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30eb\u30fc\u30eb\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u4e88\u7d04\u3092\u53d7\u3051\u308b\u3068\u304d\u3001\u300c\uff13\uff10\u65e5\u5f8c\u4ee5\u5185\u306a\u3089OK\u300d\u3068\u3057\u305f\u3044\u306a\u3089\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = ['yoyaku_date' =&gt; '2018-04-15']; \/\/ \u5931\u6557\uff08\u5b9f\u884c\u6642\u304c2018\/3\/1\u3068\u3059\u308b\uff09\r\n$rules = ['yoyaku_date' =&gt; '<strong>before:30 days<\/strong>']; \/\/ 30\u65e5\u4ee5\u5185<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u300c30 days\u300d\u306e\u66f8\u304d\u65b9\u306f\u3001<\/p>\n<ul>\n<li><strong>now<\/strong><\/li>\n<li><strong>next Sunday<\/strong><\/li>\n<li><strong>1 week<\/strong><\/li>\n<\/ul>\n<p>\u306e\u3088\u3046\u306a\u4f7f\u3044\u65b9\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3088\u308a\u8a73\u3057\u304f\u306f<a href=\"http:\/\/php.net\/manual\/ja\/function.strtotime.php\" target=\"_blank\" rel=\"noopener\">strtotime<\/a>\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3055\u308c\u305f\u65e5\u4ed8\u30c7\u30fc\u30bf\u3067\u6bd4\u8f03\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'yoyaku_date_1' =&gt; '2017-12-31',\r\n    '<strong>yoyaku_date_2<\/strong>' =&gt; '2018-01-01'\r\n];\r\n$rules = ['yoyaku_date_1' =&gt; '<strong>before:yoyaku_date_2<\/strong>'];<\/pre>\n<p><code>2017\u5e74\uff11\uff12\u6708\uff13\uff11\u65e5<\/code>\u306f\u3001<code>\uff12\uff10\uff11\uff18\u5e74\uff11\u6708\uff11\u65e5<\/code>\u3088\u308a\u3082\u524d\u306e\u65e5\u4ed8\u306a\u306e\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u901a\u904e\u3057\u307e\u3059\u3002<\/p>\n<h1>alpha\uff0falpha_dash\uff0falpha_num<\/h1>\n<p>\u6587\u5b57\u5217\u306b\u95a2\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u4e2d\u8eab\u3068\u3057\u3066\u306f\u3001<\/p>\n<ul>\n<li><strong>alpha<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u3060\u3051OK<\/li>\n<li><strong>alpha_dash<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u3068\u30c0\u30c3\u30b7\u30e5\uff08\u6a2a\u68d2\u3067\u3059\u306d\uff09\u3001\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u3060\u3051OK<\/li>\n<li><strong>alpha_num<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u3068\u6570\u5b57\u306a\u3089OK<\/li>\n<\/ul>\n<p>\u3061\u306a\u307f\u306b\u3001\u30c0\u30c3\u30b7\u30e5\u304c\u3069\u3093\u306a\u3082\u306e\u304c\u3046\u307e\u304f\u3044\u304f\u306e\u304b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>ABC-<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['text' =&gt; '<strong>alpha_dash<\/strong>'];<\/pre>\n<p>\u9a5a\u304f\u3053\u3068\u306b\u3001\u65e5\u672c\u8a9e\u306e\u300c\u30fc\u300d\u3082OK\u3067\u3057\u305f\u3002\uff08\u9006\u306b\u305d\u3046\u3058\u3083\u306a\u3044\u307b\u3046\u304c\u3044\u3044\u3088\u3046\u306a\u6c17\u306f\u3057\u307e\u3059\u3051\u3069\u306d\u30fb\u30fb\u30fb\uff09<\/p>\n<pre>$input = ['text' =&gt; '<strong>\u3042\u3044\u3046\u30fc<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u6b21\u306b\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>ABC_<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u3082\u3061\u308d\u3093\u6210\u529f\u3002<br \/>\n\u3067\u306f\u65e5\u672c\u8a9e\u306f\u30fb\u30fb\u30fb\uff1f<\/p>\n<pre>$input = ['text' =&gt; '<strong>\u3042\u3044\u3046\uff3f<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<p><strong>\u3048\uff01\u5931\u6557\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\u3002\u3002<br \/>\n<\/strong>\u3058\u3083\u3042\u3001\u30c1\u30eb\u30c0\u306f\uff1f<\/p>\n<pre>$input = ['text' =&gt; '<strong>ABC~<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<p>\u3046\u30fc\u3093\u3001\u3001\u3001<strong>\u306a\u305c\u304b\u5168\u89d2\u306e\u30c0\u30c3\u30b7\u30e5\u3060\u3051\u304cOK<\/strong>\u3068\u3044\u3046\u7d50\u679c\u306b\u3002\uff08\u5168\u89d2\u306e\u300c\u301c\u300d\u3067\u3082\u5931\u6557\u3057\u307e\u3059\uff09<br \/>\n\u3053\u308c\u306f\u3001<code>mb_convert_kana()<\/code> \u306a\u3093\u304b\u3067\u534a\u89d2\u306b\u7d71\u4e00\u3057\u3066\u304b\u3089\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3057\u305f\u307b\u3046\u304c\u826f\u3055\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n<h1>numeric\uff0finteger<\/h1>\n<p>\u5165\u529b\u5024\u304c\u6570\u5024\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u304c\u3001\u9055\u3044\u306f\uff08\u304a\u304a\u307e\u304b\u306b\u8a00\u3046\u3068\uff09<strong>\u5c0f\u6570\u70b9\u304c\u3042\u308b\u304b\u306a\u3044\u304b<\/strong>\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<strong>numeric<\/strong>\u306e\u5834\u5408\u4ee5\u4e0b\u306e\uff12\u3064\u3068\u3082\u30c1\u30a7\u30c3\u30af\u306b\u306f\u6210\u529f\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['days' =&gt; <strong>3<\/strong>]; \/\/ \u6210\u529f<\/pre>\n<pre>$input = ['days' =&gt; <strong>3.5<\/strong>]; \/\/ \u6210\u529f<\/pre>\n<p>\u3067\u3082\u3001<strong>integer<\/strong>\u306e\u5834\u5408\u306f<\/p>\n<pre>$input = ['days' =&gt; <strong>3<\/strong>]; \/\/ \u6210\u529f<\/pre>\n<pre>$input = ['days' =&gt; <strong>3.5<\/strong>]; \/\/ <strong>\u5931\u6557<\/strong><\/pre>\n<p>\uff13\uff0e\uff15\u3060\u3068\u5931\u6557\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u3082\u3057\u5c0f\u6570\u70b9\u304c\u3064\u3044\u3066\u3044\u3066\u3082\u30bc\u30ed\u306a\u3089\u554f\u984c\u306a\u304f\u30c1\u30a7\u30c3\u30af\u901a\u904e\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['days' =&gt; <strong>3.000<\/strong>]; \/\/ \u6210\u529f\r\n$rules = ['days' =&gt; 'integer'];<\/pre>\n<p>\u3061\u306a\u307f\u306b\u65e5\u672c\u8a9e\u3060\u3068\u30fb\u30fb\u30fb\uff1f<\/p>\n<pre>$input = ['days' =&gt; '<strong>\uff13<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<p><strong>numeric\uff0finteger<\/strong>\u306e\u4e21\u65b9\u3068\u3082\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<h1>between\uff0fsize\uff0fmax\uff0fmin<\/h1>\n<p>\u91cf\u3084\u5927\u304d\u3055\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\nsize\u306e\u5834\u5408\u306f\u6570\u5024\u304c\uff11\u3064\u3067\u3001between\u306f\u6570\u5024\u304c\uff12\u3064\u5fc5\u8981\u3067\u3059\u3002\uff08\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u3042\u3052\u307e\u3057\u3087\u3046\uff09<\/p>\n<p>\u3067\u306f\u3001<strong>between<\/strong>\u3067\u6570\u5024\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$input = ['days' =&gt; '<strong>3<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['days' =&gt; '<strong>numeric<\/strong>|between:2,3'];<\/pre>\n<p>\u3053\u3053\u3067\u6ce8\u610f\u3057\u306a\u3044\u3068\u3044\u3051\u3044\u306a\u3044\u306e\u304c\u3001<strong>numeric<\/strong>\u3067\u3059\u3002\u3053\u306e\u5834\u5408\u3001numeric\u3092\u7701\u7565\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306b\u5931\u6557\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001between\uff0fsize\uff0fmax\uff0fmin\u306f\u914d\u5217\u3084\u6587\u5b57\u5217\u3001\u30d5\u30a1\u30a4\u30eb\u306b\u3082\u5229\u7528\u304c\u53ef\u80fd\u3067\u3001\u914d\u5217\u306e\u5834\u5408\u306f\u3001<\/p>\n<pre>$input = ['text' =&gt; <strong>[1, 2, 3]<\/strong>]; \/\/ \u6210\u529f\r\n$rules = ['text' =&gt; '<strong>array<\/strong>|size:3'];<\/pre>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b<strong>\u8981\u7d20\u306e\u6570\u3092\u30c1\u30a7\u30c3\u30af<\/strong>\u3057\u3001\u6587\u5b57\u5217\u306e\u5834\u5408\u306f\u3001<\/p>\n<pre>$input = ['text' =&gt; '<strong>xxxx<\/strong>']; \/\/ \u5931\u6557\r\n$rules = ['text' =&gt; '<strong>string<\/strong>|max:3'];<\/pre>\n<p>\u6841\u6570\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<h1>digits\uff0fdigits_between<\/h1>\n<p><strong>\u6570\u5b57\u306e\u6841\u6570<\/strong>\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u4ee5\u4e0b\u306f\uff13\u6841\u306e\u6570\u5b57\u306a\u306e\u3067OK\u3067\u3059\u3002<\/p>\n<pre>$input = ['days' =&gt; 123]; \/\/ \u6210\u529f\r\n$rules = ['days' =&gt; '<strong>digits:3<\/strong>'];<\/pre>\n<p>\u7bc4\u56f2\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001<\/p>\n<pre>$input = ['days' =&gt; 123456]; \/\/ \u5931\u6557\r\n$rules = ['days' =&gt; '<strong>digits_between<\/strong>:3,5'];<\/pre>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001<strong>digits_between<\/strong>\u3092\u4f7f\u3063\u3066\u3042\u3052\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u6587\u5b57\u5217\u3060\u3068\u30c0\u30e1\u304b\u3068\u3044\u3046\u3068\u305d\u3046\u3067\u3082\u306a\u304f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u554f\u984c\u306a\u304f\u30d1\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$input = ['days' =&gt; '<strong>01234<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['days' =&gt; 'digits:5'];<\/pre>\n<p>\u305f\u3060\u3057\u3001\u30af\u30a9\u30fc\u30c8\u304c\u306a\u3044\u5834\u5408\u306f\u3001\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['days' =&gt; <strong>01234<\/strong>]; \/\/ \u5931\u6557\r\n$rules = ['days' =&gt; 'digits:5'];<\/pre>\n<h1>distinct<\/h1>\n<p>\u914d\u5217\u5185\u306e\u91cd\u8907\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fcID\u304c\u91cd\u8907\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['users' =&gt; [\r\n        [\r\n            'id' =&gt; <strong>1<\/strong>,\r\n            'name' =&gt; '\u592a\u90ce'\r\n        ],\r\n        [\r\n            'id' =&gt; <strong>1<\/strong>,\r\n            'name' =&gt; '\u82b1\u5b50'\r\n        ],\r\n    ]\r\n]; \/\/ \u5931\u6557\r\n$rules = ['<strong>users.*.id<\/strong>' =&gt; '<strong>distinct<\/strong>'];<\/pre>\n<p>\u3053\u306e\u5834\u5408ID\u300c\uff11\u300d\u304c\u91cd\u8907\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001<strong>users.*.id\u00a0<\/strong>\u306f\u914d\u5217\u306e\u4e2d\u8eab\u3092\u4fbf\u5229\u306b\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002\u3082\u3057\u540d\u524d\u306e\u91cd\u8907\u3092\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u306a\u3089\u300c<strong>users.*.name<\/strong>\u300d\u3068\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h1>email<\/h1>\n<p>\u3053\u308c\u306femail\u304c\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u304d\u3063\u3068\u3001\u3088\u304f\u4f7f\u3063\u3066\u3044\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<pre>$input = ['days' =&gt; 'test@example.com']; \/\/ \u6210\u529f\r\n$rules = ['days' =&gt; 'email'];<\/pre>\n<h1>exists<\/h1>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u3042\u308b\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001items\u3068\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u306bID\u300c\uff11\u300d\u306e\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u30d1\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$input = ['id' =&gt; '<strong>1<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['id' =&gt; '<strong>exists:items<\/strong>'];<\/pre>\n<p>\u30ab\u30e9\u30e0\u306f\u30ad\u30fc\u540d\uff08\u3053\u3053\u3067\u306fid\uff09\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u304c\u3001<\/p>\n<pre>$input = ['shipped_date' =&gt; '2018-01-01']; \/\/ \u6210\u529f\r\n$rules = ['shipped_date' =&gt; 'exists:items'];<\/pre>\n<p>\u3068\u3059\u308b\u3068\u3001shipped_date\u304c\u30c1\u30a7\u30c3\u30af\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3082\u3057\u304f\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u6307\u5b9a\u3059\u308b\u3068\u3001\u7279\u5b9a\u306e\u30ab\u30e9\u30e0\u540d\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\uff08<strong>shipped_date<\/strong>\u306b\u30012018-01-01\u306e\u307f\u5b58\u5728\u3057\u3066\u3044\u308b\u5834\u5408\uff09<\/p>\n<pre>$input = ['id' =&gt; '2018-01-02']; \/\/ \u5931\u6557\r\n$rules = ['id' =&gt; 'exists:items,<strong>shipped_date<\/strong>'];<\/pre>\n<p>\u305d\u3057\u3066\u3001where\u53e5\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u5236\u9650\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u914d\u5217\u5185\u306b\u6307\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>use Illuminate\\Validation\\Rule;<\/strong> \/\/ \u5fd8\u308c\u305a\u306b\uff01<\/pre>\n<pre>$input = ['id' =&gt; '1']; \/\/ \u6210\u529f\r\n$rules = ['id' =&gt; [\r\n<strong>    Rule::exists('items')-&gt;where(function ($query) {<\/strong>\r\n\r\n<strong>        $query-&gt;where('shipped_date', '2018-01-01');<\/strong>\r\n\r\n<strong>    }),<\/strong>\r\n]];<\/pre>\n<h1>file\uff0fimage<\/h1>\n<p><strong>file<\/strong>\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3001<strong>image<\/strong>\u306f\u4ee5\u4e0b\uff15\u3064\u306e\u5f62\u5f0f\u306e\u753b\u50cf\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<ul>\n<li><strong>jpeg<\/strong><\/li>\n<li><strong>png<\/strong><\/li>\n<li><strong>bmp<\/strong><\/li>\n<li><strong>gif<\/strong><\/li>\n<li><strong>svg<\/strong><\/li>\n<\/ul>\n<h1>in\uff0fnot_in<\/h1>\n<p>\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u30c7\u30fc\u30bf\u304c\u3001\u6307\u5b9a\u3057\u305f\u3082\u306e\u306e\u4e2d\u306b\u5b58\u5728\u3059\u308b\uff0f\u5b58\u5728\u3057\u306a\u3044\uff1f\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<pre>$input = ['id' =&gt; '<strong>2<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['id' =&gt; '<strong>in:1,2,3<\/strong>'];<\/pre>\n<p>\u6bce\u56de implode() \u3092\u4f7f\u3063\u3066\u306e\u7d50\u5408\u304c\u5acc\u306a\u5834\u5408\u306f\u3001<\/p>\n<pre>use Illuminate\\Validation\\Rule;<\/pre>\n<pre>$input = ['id' =&gt; <strong>2<\/strong>]; \/\/ \u6210\u529f\r\n$rules = ['id' =&gt; [\r\n    <strong>Rule::in([1, 2, 3])<\/strong>\r\n]];<\/pre>\n<p>\u3068\u3044\u3046\u98a8\u306b\u3059\u308c\u3070\u3001\u76f4\u63a5\u914d\u5217\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>ip\uff0fipv4\uff0fipv6<\/h1>\n<p>\u30c7\u30fc\u30bf\u304c\u3001ip\u3001\u3082\u3057\u304f\u306f\u3001ipv4\u3001ipv6\u3068\u3057\u3066\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '192.168.0.1'];\r\n$rules = ['text' =&gt; 'ip:']; \/\/ \u6210\u529f<\/pre>\n<h1>json<\/h1>\n<p>json\u304c\u6b63\u3057\u3044\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<pre>$input = ['id' =&gt; '<strong>[{\"id\":\"1\"}]<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['id' =&gt; '<strong>json<\/strong>'];<\/pre>\n<h1>mimetypes\uff0fmimes<\/h1>\n<p>\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306emime\u30bf\u30a4\u30d7\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3001\u9055\u3044\u306f\u76f4\u63a5mime\u30bf\u30a4\u30d7\u3092\u6307\u5b9a\u3059\u308b\u304b\u3001\u62e1\u5f35\u5b50\u3092\u6307\u5b9a\u3059\u308b\u304b\u3067\u3059\u3002<\/p>\n<pre>'video' =&gt; '<strong>mimetypes<\/strong>:video\/avi,video\/mpeg'<\/pre>\n<pre>'photo' =&gt; '<strong>mimes<\/strong>:jpeg,png,gif'<\/pre>\n<p>\u3061\u306a\u307f\u306bmimes\u306e\u62e1\u5f35\u5b50\u4e00\u89a7\u306f<a href=\"https:\/\/svn.apache.org\/repos\/asf\/httpd\/httpd\/trunk\/docs\/conf\/mime.types\">\u3053\u3061\u3089<\/a>\u3067\u3059\u3002<\/p>\n<h1>nullable<\/h1>\n<p>null\u3092\u8a31\u53ef\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4e2d\u8eab\u304cnull\u3067\u3042\u3063\u3066\u3082\u3001<\/p>\n<pre>$input = ['text' =&gt; null]; \/\/ \u6210\u529f\r\n$rules = ['text' =&gt; 'nullable'];<\/pre>\n<p>\u4e2d\u8eab\u304c\u5165\u3063\u3066\u3044\u3066\u3082OK\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; 'test']; \/\/ \u6210\u529f\r\n$rules = ['text' =&gt; 'nullable'];<\/pre>\n<p>\u3064\u307e\u308a\u3001\u300c\u5165\u529b\u3057\u305f\u3051\u308c\u3070\u3057\u3066\u3082\u3044\u3044\u3088\u300d\u3068\u3044\u3046\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306a\u3069\u306b\u5229\u7528\u3055\u308c\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<h1>present\uff0ffilled<\/h1>\n<p>\u3069\u3061\u3089\u3082\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u304c\u3001\u9055\u3044\u306f<strong>\u9001\u4fe1\u30c7\u30fc\u30bf\u5185\u306b\u30ad\u30fc\u304c\u3042\u308b\u304b\u3069\u3046\u304b<\/strong>\u3067\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001<strong>present<\/strong>\u306e\u5834\u5408\u4e2d\u8eab\u304cnull\u3067\u3082\u6210\u529f\u3057\u307e\u3059\u304c\u3001<\/p>\n<pre>$input = ['text' =&gt; <strong>null<\/strong>]; \/\/ \u6210\u529f\r\n$rules = ['text' =&gt; '<strong>present<\/strong>'];<\/pre>\n<p><strong>filled<\/strong>\u306e\u5834\u5408\u306f\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; <strong>null<\/strong>]; \/\/ \u5931\u6557\r\n$rules = ['text' =&gt; '<strong>filled<\/strong>'];<\/pre>\n<p>\u3067\u306f\u3001<strong>present<\/strong>\u304c\u3069\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u5931\u6557\u3059\u308b\u306e\u304b\u3068\u3044\u3046\u3068\u3001\u3053\u306e\u3088\u3046\u306b\u30ad\u30fc\u304c\u9001\u4fe1\u30c7\u30fc\u30bf\u5185\u306b\u5b58\u5728\u3057\u3066\u3044\u306a\u3044\u6642\u3067\u3059\u3002<\/p>\n<pre>$input = ['<strong>text_2<\/strong>' =&gt; 'xxxx']; \/\/ \u5931\u6557\r\n$rules = ['<strong>text_1<\/strong>' =&gt; '<strong>present<\/strong>'];<\/pre>\n<p>\u203b\u3064\u307e\u308a\u3001\u300ctext_1\u3092\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u306e\u306b\u3001\u30ad\u30fc\u305d\u306e\u3082\u306e\u304c\u5b58\u5728\u3057\u3066\u306a\u3044\u3058\u3083\u306a\u3044\u304b\uff01\u300d\u3068\u6012\u3063\u3066\u308b\u3093\u3067\u3059\u306d\u3002<\/p>\n<h1>regex<\/h1>\n<p>\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u3001\u6587\u5b57\u5217\u304c\u30de\u30c3\u30c1\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30eb\u30fc\u30eb\u306f\u3001\u914d\u5217\u3092\u4f7f\u3063\u3066\u5229\u7528\u3057\u307e\u3059\u3002\uff08\u306a\u305c\u306a\u3089\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u306e\u533a\u5207\u308a\u306b\u300c|\u300d\u304c\u4f7f\u308f\u308c\u308b\u304b\u3089\u3067\u3059\u306d\uff09<\/p>\n<pre>$input = ['text' =&gt; '5']; \/\/ \u5931\u6557\r\n$rules = ['text' =&gt; <strong>[<\/strong>\r\n<strong>    'Regex:\/[a-z]\/'<\/strong>\r\n<strong>]<\/strong>];<\/pre>\n<h1>required\uff08\u3068\u3001\u305d\u306e\u4ed6\u95a2\u9023\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff09<\/h1>\n<p><strong>required<\/strong>\u306f\u300c\u5fc5\u305a\u30c7\u30fc\u30bf\u304c\u306a\u3044\u3068\u30c0\u30e1\uff01\u300d\u3068\u3044\u3046\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u304c\u3001\u3053\u308c\u306b\u306f\u3044\u308d\u3044\u308d\u95a2\u9023\u3059\u308b\u3082\u306e\u304c\u3042\u3063\u3066\u3001\u73fe\u5728\u306e\u3068\u3053\u308d\u4ee5\u4e0b\u306e\uff17\u3064\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>required<\/strong><\/li>\n<li><strong>required_if<\/strong><\/li>\n<li><strong>required_unless<\/strong><\/li>\n<li><strong>required_with<\/strong><\/li>\n<li><strong>required_with_all<\/strong><\/li>\n<li><strong>required_without<\/strong><\/li>\n<li><strong>required_without_all<\/strong><\/li>\n<\/ul>\n<p>\u4e2d\u306b\u306f\u8907\u96d1\u306a\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3072\u3068\u3064\u3072\u3068\u3064\u4f8b\u3067\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff08\uff11\uff09 <strong>required<\/strong><\/p>\n<p>\u3053\u308c\u306f\u57fa\u672c\u4e2d\u306e\u57fa\u672c\u3067\u3059\u306d\u3002<br \/>\n\u304d\u3063\u3068\u4e00\u756a\u3088\u304f\u4f7f\u3063\u3066\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<pre>$input = ['text' =&gt; '']; \/\/ \u5931\u6557\r\n$rules = ['text' =&gt; 'required'];<\/pre>\n<p>\uff08\uff12\uff09\u00a0<strong>required_if<\/strong><\/p>\n<p>\u300c\u3082\u3057\u3001\u4ed6\u306e\u5165\u529b\u30c7\u30fc\u30bf\u304c\u300c***\u300d\u306a\u3089\u3001\u3053\u3053\u306f\u5fc5\u9808\u3067\u3059\u3088\uff01\u300d\u3068\u3044\u3046\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3002<br \/>\n\u4ee5\u4e0b\u306e\u4f8b\u3067\u3044\u3046\u3068\u3001\u300c<strong>\u3082\u3057\u3001text_1\u304cxxx\u306a\u3089\u3001text_2\u306f\u5165\u529b\u5fc5\u9808<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '<strong>xxx<\/strong>',\r\n    'text_2' =&gt; ''\r\n]; \/\/ \u5931\u6557\r\n$rules = ['text_2' =&gt; '<strong>required_if:text_1,xxx<\/strong>'];<\/pre>\n<p>\uff08\uff13\uff09\u00a0<strong>required_unless<\/strong><\/p>\n<p>\u3053\u308c\u306f<strong>required_if<\/strong>\u306e\u9006\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3001\u300c\u3082\u3057\u3001\u4ed6\u306e\u5165\u529b\u30c7\u30fc\u30bf\u304c\u300c***\u300d<strong>\u4ee5\u5916<\/strong>\u306a\u3089\u3001\u3053\u3053\u306f\u5fc5\u9808\u3067\u3059\u3088\uff01\u300d\u3068\u3044\u3046\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3002<br \/>\n\u4f8b\u306f\u3001\u300c<strong>\u3082\u3057\u3001text_1\u304cyyy\u4ee5\u5916\u306a\u3089\u3001text_2\u306f\u5165\u529b\u5fc5\u9808<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; 'xxx',\r\n    'text_2' =&gt; ''\r\n]; \/\/ \u5931\u6557\r\n$rules = ['text_2' =&gt; '<strong>required_unless:text_1,yyy<\/strong>'];<\/pre>\n<p>\uff08\uff14\uff09 <strong>required_with<\/strong><\/p>\n<p>\u300c\u4ed6\u306e\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u3066\u308b\u306a\u3089\u3001\u3053\u3053\u306f\u5fc5\u9808\u3067\u3059\u300d\u3068\u3044\u3046\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u300c<strong>\u3082\u3057text_1\u304c\u5b58\u5728\u3057\u3066\u308b\u306a\u3089\u3001text_2\u306f\u5fc5\u9808\u5165\u529b<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '<strong>xxx<\/strong>',\r\n    'text_2' =&gt; ''\r\n]; \/\/ \u5931\u6557\r\n$rules = ['text_2' =&gt; '<strong>required_with:text_1<\/strong>'];<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '',\r\n    'text_2' =&gt; ''\r\n]; \/\/ \u6210\u529f\r\n$rules = ['text_2' =&gt; 'required_with:text_1'];<\/pre>\n<pre>$input = [\r\n    'text_2' =&gt; ''\r\n]; \/\/ \u6210\u529f\r\n$rules = ['text_2' =&gt; 'required_with:text_1'];<\/pre>\n<p>\u4e2d\u8eab\u304c\u7a7a\u767d\u3067\u3082\u3001\u30ad\u30fc\u81ea\u4f53\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u3082\u300c<strong>\u5b58\u5728\u3057\u306a\u3044<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\uff08\uff15\uff09 <strong>required_without<\/strong><\/p>\n<p><strong>required_with<\/strong>\u306e\u9006\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306f\u3001\u300c<strong>\u3082\u3057\u3001text_1\u304c\u7a7a\u767d\uff08\u5b58\u5728\u3057\u306a\u3044\uff09\u306a\u3089\u3001text_2\u306f\u5fc5\u9808\u5165\u529b<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u3001text_1\u304btext_2\u3069\u3063\u3061\u304b\u306b\u30c7\u30fc\u30bf\u304c\u5165\u3063\u3066\u3044\u308c\u3070\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u901a\u904e\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '',\r\n    'text_2' =&gt; '' \/\/ \u5fc5\u9808\r\n]; \/\/ \u5931\u6557\r\n$rules = ['text_2' =&gt; '<strong>required_without:text_1<\/strong>'];<\/pre>\n<p>\uff08\uff16\uff09 <strong>required_with_all<\/strong><\/p>\n<p><strong>required_with<\/strong>\u306e\u8907\u6570\u5f62\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u4e0b\u306e\u4f8b\u3060\u3068\u3001\u300c<strong>text_1\u3068text_2\u306e\u30c7\u30fc\u30bf\u304c\u3042\u308b\u306a\u3089\u3001text_3\u3082\u5fc5\u9808\u5165\u529b<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '<strong>x<\/strong>',\r\n    'text_2' =&gt; '<strong>y<\/strong>',\r\n    'text_3' =&gt; '' \/\/ \u5fc5\u9808\r\n]; \/\/ \u5931\u6557\r\n$rules = ['text_3' =&gt; '<strong>required_with_all:text_1,text_2<\/strong>'];<\/pre>\n<p>\uff08\uff17\uff09 <strong>required_without_all<\/strong><\/p>\n<p>required_without\u306e\u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u4e0b\u306e\u4f8b\u306f\u3001\u300c<strong>text_1\u3068text_2\u304c\u7a7a\u767d\uff08\u5b58\u5728\u3057\u306a\u3044\uff09\u306a\u3089\u3001text_3\u306f\u5fc5\u9808\u5165\u529b<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '',\r\n    'text_2' =&gt; '',\r\n    'text_3' =&gt; '' \/\/ \u5fc5\u9808\r\n]; \/\/ \u5931\u6557\r\n$rules = ['text_3' =&gt; '<strong>required_without_all:text_1,text_2<\/strong>'];<\/pre>\n<h1>same\uff0fdifferent<\/h1>\n<p>\u4ed6\u306e\u30c7\u30fc\u30bf\u3068\u540c\u3058\u5024\u304b\u3069\u3046\u304b\u3001\u3082\u3057\u304f\u306f\u9055\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\n<strong>same<\/strong>\u306e\u5834\u5408\u3001\u6b21\u306e\u4f8b\u306f\u300c<strong>text_2\u306e\u5024\u306f\u3001text_1\u3068\u4e00\u7dd2\uff1f<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '<strong>xxx<\/strong>',\r\n    'text_2' =&gt; '<strong>xxx<\/strong>'\r\n]; \/\/ \u6210\u529f\r\n$rules = ['text_2' =&gt; '<strong>same:text_1<\/strong>'];<\/pre>\n<p>\u305d\u3057\u3066\u3001<strong>different<\/strong>\u306e\u5834\u5408\u306f\u3001\u300c<strong>\u540c\u3058\u3060\u3068\u30c0\u30e1<\/strong>\u300d\u3068\u3044\u3046\u610f\u5473\u306a\u306e\u3067\u3001\u6b21\u306e\u4f8b\u3060\u3068\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306b\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; '<strong>xxx<\/strong>',\r\n    'text_2' =&gt; '<strong>xxx<\/strong>'\r\n];\r\n$rules = ['text_1' =&gt; '<strong>different:text_2<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<h1>starts_with<\/h1>\n<p>\u30c6\u30ad\u30b9\u30c8\u304c\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3067\u306f\u3058\u307e\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u203b Laravel <code>5.7.15<\/code>\u3067\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<pre>$input = ['name' =&gt; '<strong>value<\/strong>']; \/\/ \u5931\u6557\r\n$rules = ['name' =&gt; '<strong>starts_with:valx<\/strong>'];<\/pre>\n<p>\u306a\u304a\u3001\u30c1\u30a7\u30c3\u30af\u3059\u308b\u6587\u5b57\u5217\u306f\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u8907\u6570\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$input = ['name' =&gt; 'value']; \/\/ \u5931\u6557\r\n$rules = ['name' =&gt; 'starts_with:<strong>vae,valx,vale<\/strong>'];<\/pre>\n<p>\u307e\u305f\u3001\u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u3067\u3082\u6a5f\u80fd\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['name' =&gt; '<strong>\u6771\u4eac\u90fd\u4e16\u7530\u8c37\u533a<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['name' =&gt; 'starts_with:<strong>\u6771\u4eac<\/strong>'];<\/pre>\n<h1>timezone<\/h1>\n<p>\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>Asia\/Tokyo<\/strong>']; \/\/ \u6210\u529f\r\n$rules = ['text' =&gt; '<strong>timezone<\/strong>'];<\/pre>\n<h1>unique<\/h1>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306b\u540c\u3058\u5024\u304c\u306a\u3044\u304b\uff08\u3042\u3063\u3066\u306f\u3044\u3051\u306a\u3044\uff09\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3084ID\u306a\u3069\u91cd\u8907\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u3082\u306e\u306a\u3069\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n<pre>\/\/ \u3059\u3067\u306bid\u306b\u300c1\u300d\u306e\u30c7\u30fc\u30bf\u304c\u3042\u308b\u5834\u5408\r\n\r\n$input = ['id' =&gt; '1'];\r\n$rules = ['id' =&gt; '<strong>unique:users<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<p><strong>exists<\/strong>\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3068\u540c\u3058\u304f\u3001\u30c1\u30a7\u30c3\u30af\u3055\u308c\u308b\u30ab\u30e9\u30e0\u540d\u306f\u30ad\u30fc\u540d\u3067\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001\u4ee5\u4e0b\u306f<strong>email<\/strong>\u30ab\u30e9\u30e0\u304c\u30c1\u30a7\u30c3\u30af\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>\/\/ \u3059\u3067\u306bemail\u306b\u300cadmin@example.com\u300d\u306e\u30c7\u30fc\u30bf\u304c\u3042\u308b\u5834\u5408\r\n\r\n$input = ['<strong>email<\/strong>' =&gt; 'admin@example.com'];\r\n$rules = ['<strong>email<\/strong>' =&gt; 'unique:users']; \/\/ \u5931\u6557<\/pre>\n<p>\u305f\u3060\u3001\u3082\u3057\u30ad\u30fc\u540d\u3067\u306f\u306a\u304f\u3066\u7279\u5b9a\u306e\u30ab\u30e9\u30e0\u540d\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001<\/p>\n<pre>$input = ['email' =&gt; 'admin@example.com'];\r\n$rules = ['email' =&gt; 'unique:users,<strong>email_address<\/strong>'];<\/pre>\n<p>\u3068\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u306a\u3069\u3001\u300c\u81ea\u5206<strong>\u4ee5\u5916<\/strong>\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u91cd\u8907\u7981\u6b62\u300d\u3068\u3044\u3063\u305f\u5834\u5408\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f8b\u5916\u3092\u3064\u3051\u3066\u3042\u3052\u307e\u3059\u3002<\/p>\n<pre>use Illuminate\\Validation\\Rule;<\/pre>\n<pre>$user_id = 1;\r\n$input = ['email' =&gt; 'admin@example.com'];\r\n$rules = ['email' =&gt;\r\n    <strong>Rule::unique('users')-&gt;ignore($user_id)<\/strong>\r\n];<\/pre>\n<p>\u3053\u306e\u4f8b\u306f\u3001\u300c<strong>users\u30c6\u30fc\u30d6\u30eb\u306eid\u304c1\u306e\u3082\u306e\u4ee5\u5916\u3067\u91cd\u8907\u7981\u6b62<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002\u3082\u3057id\u4ee5\u5916\u3067\u30c7\u30fc\u30bf\u306e\u9664\u5916\u3092\u3057\u305f\u3044\u5834\u5408\u306f\u3001<\/p>\n<pre>Rule::unique('users')-&gt;ignore($user_id, <strong>'user_id'<\/strong>)<\/pre>\n<p>\u3068\u3044\u3046\u98a8\u306b\u7b2c\u4e8c\u5f15\u6570\u306b\u30ab\u30e9\u30e0\u540d\u3092\u8a18\u8ff0\u3057\u3066\u3042\u3052\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001where\u53e5\u3092\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u90fd\u9053\u5e9c\u770c\u304c\u300c\u6771\u4eac\u90fd\u300d\u3068\u306a\u3063\u3066\u308b\u4eba\u306e\u4e2d\u304b\u3089\u91cd\u8907\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>use Illuminate\\Validation\\Rule;<\/pre>\n<pre>$input = ['email' =&gt; 'admin@example.com'];\r\n$rules = ['email' =&gt;\r\n    <strong>Rule::unique('users')-&gt;where(function ($query) {<\/strong>\r\n\r\n<strong>        return $query-&gt;where('todofuken', '\u6771\u4eac\u90fd');<\/strong>\r\n\r\n<strong>    })<\/strong>\r\n];<\/pre>\n<p>\u6ce8\u610f\u3059\u3079\u304d\u70b9\u306f\u3001\u300cwhere\u53e5\u3067\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u306e\u4e2d\u306b\u3001\u540c\u3058\u3082\u306e\u304c\u3042\u3063\u3066\u306f\u3044\u3051\u306a\u3044\u300d\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u4e0a\u306e\u4f8b\u3067\u3044\u3046\u3068\u300c<strong>\u6771\u4eac\u90fd\u306b\u4f4f\u3093\u3067\u3044\u308b\u4eba\u3067\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304cadmin@example.com\u306e\u4eba\u306f\u3044\u306a\u3044\u3088\u306d\uff1f\uff08\u3044\u3061\u3083\u30c0\u30e1\uff09<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>url<\/h1>\n<p>URL\u304c\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; 'http:\/\/google.com'];\r\n$rules = ['text' =&gt; '<strong>url<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u3061\u306a\u307f\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b<strong>https<\/strong>\u3082OK\u3067\u3059\u3057\u3001\u30dd\u30fc\u30c8\u756a\u53f7\u3084\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5165\u3063\u3066\u3044\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>https:\/\/google.com:8000\/xxx\/yyy\/zzz?key=value<\/strong>'];\r\n$rules = ['text' =&gt; '<strong>url<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<h1>active_url<\/h1>\n<p>DNS\u30ea\u30bd\u30fc\u30b9\u30ec\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3057\u3001\u300cA\u300d\u3082\u3057\u304f\u306f\u300cAAAA\u300d\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3002<\/p>\n<h1>boolean<\/h1>\n<p>boolean\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; true];\r\n$rules = ['text' =&gt; '<strong>boolean<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u771f\u507d\u5024\u4ee5\u5916\u306f\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; 3];\r\n$rules = ['text' =&gt; '<strong>boolean<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<h1>string<\/h1>\n<p>\u6587\u5b57\u5217\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; 'xxx'];\r\n$rules = ['text' =&gt; 'string']; \/\/ \u6210\u529f<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001<\/p>\n<pre>$input = ['text' =&gt; <strong>'3'<\/strong>];\r\n$rules = ['text' =&gt; 'string']; \/\/ \u6210\u529f<\/pre>\n<p>\u306f\u30d1\u30b9\u3057\u307e\u3059\u3051\u3069\u3001\u4ee5\u4e0b\u306f\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; <strong>3<\/strong>];\r\n$rules = ['text' =&gt; 'string']; \/\/ \u5931\u6557<\/pre>\n<h1>array<\/h1>\n<p>\u914d\u5217\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; [1, 2, 3]];\r\n$rules = ['text' =&gt; '<strong>array<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<h1>Confirmed<\/h1>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u3082\u3089\u3046\u3068\u304d\u3001\u5165\u529b\u30dc\u30c3\u30af\u30b9\u304c\u25cf\u25cf\u25cf\u25cf\u25cf\u3067\u96a0\u3055\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u30df\u30b9\u30bf\u30a4\u30d7\u304c\u3042\u308b\u304b\u3069\u3046\u304b\u3001\u76ee\u3067\u898b\u3066\u5224\u65ad\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u306b\u3001\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\uff08\u78ba\u8a8d\uff09\u300d\u306a\u3069\u3068\u3057\u3066\u3001\u3082\u3046\u4e00\u5ea6\u540c\u3058\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u3082\u3089\u3046\u5834\u9762\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u5834\u5408\u306b\u3001\uff11\u3064\u3081\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\uff12\u3064\u76ee\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3001\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'password' =&gt; 'xxx',\r\n    'password_confirmation' =&gt; 'xxxw'\r\n];\r\n$rules = ['password' =&gt; '<strong>confirmed<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u306f\u3001\u30ad\u30fc\u540d\u3067\u3059\u3002<br \/>\n\u3068\u3044\u3046\u306e\u3082\u3001confirmed \u306f\u30ad\u30fc\u540d\u304c\u3001\u300c<strong>\u305d\u306e\u30ad\u30fc\u540d \uff0b _confirmation<\/strong>\u300d\u3092\u81ea\u52d5\u3067\u63a2\u3057\u3066\u6587\u5b57\u5217\u306e\u6bd4\u8f03\u3092\u884c\u3063\u3066\u304f\u308c\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001HTML\u3067\u3044\u3046\u3068\u3001<\/p>\n<pre>\u30d1\u30b9\u30ef\u30fc\u30c9\uff1a &lt;br&gt;\r\n&lt;input name=\"<strong>password<\/strong>\" type=\"password\"&gt;\r\n\r\n\u30d1\u30b9\u30ef\u30fc\u30c9\uff08\u78ba\u8a8d\uff09\uff1a&lt;br&gt;\r\n&lt;input name=\"<strong>password_confirmation<\/strong>\" type=\"password\"&gt;<\/pre>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001<strong>name<\/strong>\u304c<\/p>\n<ul>\n<li>password<\/li>\n<li>password_<strong>confirmation<\/strong><\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\uff12\u3064\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h1>date<\/h1>\n<p>date\u306f\u3001\u65e5\u4ed8\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u4f7f\u3044\u65b9\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '2018-01-01'];\r\n$rules = ['text' =&gt; '<strong>date<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u65e5\u4ed8\u306b\u30b9\u30e9\u30c3\u30b7\u30e5\u3092\u4f7f\u3063\u3066\u3082\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u30d1\u30b9\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>2018\/01\/01<\/strong>'];\r\n$rules = ['text' =&gt; 'date']; \/\/ \u6210\u529f<\/pre>\n<p>\u6708\u65e5\u306e\u30bc\u30ed\u3092\u7701\u7565\u3057\u3066\u3082OK\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>2018\/1\/1<\/strong>'];\r\n$rules = ['text' =&gt; 'date']; \/\/ \u6210\u529f<\/pre>\n<p>\u3067\u3082\u3001\u5e74\u3092\u7701\u7565\u3059\u308b\u3068\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>18\/1\/1<\/strong>'];\r\n$rules = ['text' =&gt; 'date']; \/\/ \u5931\u6557<\/pre>\n<p>\u3082\u3061\u308d\u3093\u3001\u3042\u308a\u3048\u306a\u3044\u65e5\u4ed8\u3082\u30a2\u30a6\u30c8\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>2018\/2\/29<\/strong>'];\r\n$rules = ['text' =&gt; 'date']; \/\/ \u5931\u6557<\/pre>\n<p>\u305d\u3057\u3066\u3001\u5168\u89d2\u6587\u5b57\u3082\u30c0\u30e1\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>\uff12\uff10\uff11\uff18\u5e74\uff11\u6708\uff11\u65e5<\/strong>'];\r\n$rules = ['text' =&gt; 'date']; \/\/ \u5931\u6557<\/pre>\n<h1>date_equals<\/h1>\n<p>\u5165\u529b\u3055\u308c\u305f\u65e5\u4ed8\u304c\u540c\u3058\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>2018-01-01<\/strong>'];\r\n$rules = ['text' =&gt; '<strong>date_equals:2018-01-01<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u3053\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u3001<a href=\"http:\/\/php.net\/manual\/ja\/function.strtotime.php\" target=\"_blank\" rel=\"noopener\">strtotime<\/a>\u95a2\u6570\u3092\u4f7f\u3063\u3066\u304f\u308c\u308b\u306e\u3067\u3001\u30cf\u30a4\u30d5\u30f3\u3068\u30b9\u30e9\u30c3\u30b7\u30e5\u306a\u3069\u8868\u8a18\u304c\u9055\u3063\u3066\u3044\u3066\u3082\u5b9f\u969b\u306e\u65e5\u4ed8\u304c\u540c\u3058\u306a\u3089\u304d\u3061\u3093\u3068\u901a\u904e\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>2018-01-01<\/strong>'];\r\n$rules = ['text' =&gt; 'date_equals:<strong>2018\/1\/1<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u306a\u304a\u3001Laravel <code>5.7.15<\/code>\u304b\u3089\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7ffb\u8a33\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre><strong>\/\/ resources\/lang\/en\/validation.php<\/strong>\r\n'date_equals' =&gt; 'The :attribute must be a date equal to <strong>:date<\/strong>.',<\/pre>\n<p>\u65e5\u672c\u8a9e\u306e\u5834\u5408\u306f\u3053\u3093\u306a\u30ab\u30f3\u30b8\u3067\u3059\u3002<\/p>\n<pre><strong>\/\/ resources\/lang\/ja\/validation.php<\/strong>\r\n'date_equals' =&gt; ':attribute\u306f\u3001<strong>:date<\/strong>\u3068\u540c\u3058\u65e5\u4ed8\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002',<\/pre>\n<p>\u5b9f\u969b\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>text\u306f\u30012018-01-01\u3068\u540c\u3058\u65e5\u4ed8\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/pre>\n<h1>date_format<\/h1>\n<p>\u65e5\u4ed8\u306e\u8868\u8a18\u304c\u3042\u3063\u3066\u3044\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u6b21\u306e\u5f62\u306a\u3089\u6210\u529f\u3057\u307e\u3059\u304c\u3001<\/p>\n<pre>$input = ['text' =&gt; '<strong>2018-01-01<\/strong>'];\r\n$rules = ['text' =&gt; '<strong>date_format:Y-m-d<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u3053\u3061\u3089\u306e\u5834\u5408\u3060\u3068\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>$input = ['text' =&gt; '<strong>2018-1-1<\/strong>'];\r\n$rules = ['text' =&gt; '<strong>date_format:Y-m-d<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<h1>dimensions<\/h1>\n<p>\u753b\u50cf\u306e\u30b5\u30a4\u30ba\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u4f7f\u3048\u308b\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u4ee5\u4e0b\u306e\uff17\u30d1\u30bf\u30fc\u30f3\u3002<\/p>\n<ul>\n<li><strong><em>min_width<\/em><\/strong><\/li>\n<li><strong><em>max_width<\/em><\/strong><\/li>\n<li><strong><em>min_height<\/em><\/strong><\/li>\n<li><strong><em>max_height<\/em><\/strong><\/li>\n<li><strong><em>width<\/em><\/strong><\/li>\n<li><strong><em>height<\/em><\/strong><\/li>\n<li><strong><em>ratio<\/em><\/strong><\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30a4\u30b3\u30fc\u30eb\u300c\uff1d\u300d\u3067\u3064\u306a\u3052\u3066\u3001\u30ab\u30f3\u30de\u3067\u533a\u5207\u308a\u307e\u3059\u3002<\/p>\n<pre>$rules = ['image' =&gt; '<strong>dimensions:min_width=100,min_height=200<\/strong>'];<\/pre>\n<p>\u3061\u306a\u307f\u306bratio\u306e\u5834\u5408\u306f\u3001\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$rules = ['image' =&gt; '<strong>dimensions:ratio=3\/2<\/strong>'];<\/pre>\n<h1>in_array<\/h1>\n<p>\u4ed6\u306e\u914d\u5217\u30c7\u30fc\u30bf\u306e\u4e2d\u306b\u3001\u540c\u3058\u3082\u306e\u304c\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u4f7f\u3044\u65b9\u306f\u3001\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; <strong>['x', 'y', 'z']<\/strong>,\r\n    'text_2' =&gt; <strong>'x'<\/strong>\r\n];\r\n$rules = ['text_2' =&gt; '<strong>in_array:text_1.*<\/strong>']; \/\/ \u6210\u529f<\/pre>\n<p>\u6c17\u3092\u3064\u3051\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u304c\u3001in_array\u306f\u30c9\u30c3\u30c8\u3064\u306a\u304e\u3067\u6e21\u3055\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3068\u8a00\u3046\u70b9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30ad\u30fc\u540d\u3060\u3051\u3067\u5b9f\u884c\u3057\u3066\u3082\u3046\u307e\u304f\u3044\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre>$input = [\r\n    'text_1' =&gt; ['x', 'y', 'z'],\r\n    'text_2' =&gt; 'x'\r\n];\r\n$rules = ['text_2' =&gt; '<strong>in_array:text_1<\/strong>']; \/\/ \u5931\u6557<\/pre>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u7279\u306b<strong>confirmed<\/strong>\u306e\u3088\u3046\u306b\u3001\u300c\u3084\u308b\u5fc5\u8981\u306e\u306a\u3044\u3053\u3068\u306f\u3001\u6975\u529b\u3084\u3089\u306a\u3044\u3067OK\u306b\u3059\u308b\u300d\u3068\u3044\u3046\u70b9\u304cLaravel\u304c\u3053\u308c\u3060\u3051\u611b\u3055\u308c\u308b\u7406\u7531\u306a\u306e\u3060\u308d\u3046\u306a\u3001\u3068\u3064\u304f\u3065\u304f\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u65e5\u672c\u306e\u50cd\u304d\u65b9\u6539\u9769\u3082\u3053\u3046\u3042\u3063\u3066\u307b\u3057\u3044\u3082\u306e\u3067\u3059\uff08\u7b11\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u306b\u306f\u3044\u3064\u3082\u958b\u767a\u306e\u4f5c\u696d\u52b9\u7387\u3092\u3042\u3052\u3066\u3082\u3089\u3063\u3066\u3001\u3068\u3066\u3082\u611f\u8b1d\u3057\u3066\u3044\u308b\u3093\u3067\u3059\u3051\u3069\u3001\u305d\u306e\u4e2d\u3067\u3082\u30c8\u30c3\u30d7\u30af\u30e9\u30b9\u3067\u3042\u308a\u304c\u305f\u3044\u3068\u611f\u3058\u308b\u3082\u306e\u3001\u305d\u308c\u304c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u3067 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=341\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u516854\u7a2e\u985e\uff01Laravel 5.7\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5b9f\u4f8b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2759,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[5],"class_list":["post-341","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-php","tag-5"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=341"}],"version-history":[{"count":9,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":2762,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/341\/revisions\/2762"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2759"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}