{"id":10899,"date":"2022-09-26T07:00:42","date_gmt":"2022-09-25T22:00:42","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=10899"},"modified":"2022-09-01T06:02:51","modified_gmt":"2022-08-31T21:02:51","slug":"laravel-react-%e3%81%a7%ef%bc%92%e6%ae%b5%e9%9a%8e%e3%80%8c%e3%83%90%e3%83%aa%e3%83%87%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%80%8d%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=10899","title":{"rendered":"Laravel + React \u3067\uff12\u6bb5\u968e\u300c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u300d\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u308c\u306f\u5b9f\u969b\u306b\u79c1\u304c\u4f7f\u3063\u3066\u307f\u3066\u300c<strong>\u3046\u30fc\u3093\u2026<\/strong>\u300d\u3068\u306a\u3063\u305f\u8a71\u306a\u306e\u3067\u3059\u304c\u3001\u5c11\u3057\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306b\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><strong style=\"font-size: 35px;\">\u30d5\u30a1\u30a4\u30eb\u4ee5\u5916\u306e\u30c7\u30fc\u30bf\u304c\u9593\u9055\u3063\u3066\u3044\u3066\u3001\u307e\u305f\u6642\u9593\u3092\u304b\u3051\u3066\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u306a\u304f\u3061\u3083\u3044\u3051\u306a\u304f\u306a\u3063\u305f\u2026\ud83d\ude29<\/strong><\/p>\n<p>\u3064\u307e\u308a\u3001\u3053\u308c\u306f\u4ee5\u4e0b\u306e\u6d41\u308c\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u3001\u307e\u305f\u9577\u3044\u5f85\u3061\u6642\u9593\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u8a33\u3067\u3059\u2026<\/p>\n<ol>\n<li>\u30c7\u30fc\u30bf\uff06\u30d5\u30a1\u30a4\u30eb\u9001\u4fe1<\/li>\n<li>\u30c7\u30fc\u30bf\u304c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306b\u5f15\u3063\u304b\u304b\u3063\u305f<\/li>\n<li>\u5165\u529b\u3092\u76f4\u3057\u3066\u307e\u305f\u9001\u4fe1\uff08\uff1d\u6642\u9593\u304c\u304b\u304b\u308b\uff09<\/li>\n<\/ol>\n<p>\u3055\u3059\u304c\u306b\u3053\u308c\u306f\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u3068\u3057\u3066\u826f\u3044\u3053\u3068\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u4eca\u56de\u300c<strong>\uff12\u6bb5\u968e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/strong>\u300d\u306a\u308b\u3082\u306e\u3092\u4f5c\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u9001\u4fe1\u304c\u65e9\u3044\u300c<strong>\u30d5\u30a1\u30a4\u30eb\u4ee5\u5916<\/strong>\u300d\u306e\u5165\u529b\u30c7\u30fc\u30bf\u3060\u3051\u5148\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u304b\u3051\u3001\u554f\u984c\u304c\u306a\u3051\u308c\u3070\u30d5\u30a1\u30a4\u30eb\u3082\u5408\u308f\u305b\u3066\u9001\u4fe1\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u203b \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3059\u308c\u3070\u3044\u3044\u3068\u3082\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7d50\u5c40\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3082\u7528\u610f\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001\u3069\u3046\u305b\u3060\u3063\u305f\u3089\u4e00\u5143\u7ba1\u7406\u3057\u305f\u3044\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f<code>Laravel + React<\/code>\u3067\uff12\u6bb5\u968e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306a\u308b\u3082\u306e\u3092\u5b9f\u88c5\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><br \/>\n\u300c\u30d3\u30a2\u30d0\u30fc\u3067\u3068\u306a\u308a\u306b\u3044\u305f<br \/>\n\u6d77\u5916\u306e\u65b9\u3068\u8a71\u3057\u3066\u307f\u305f\u3089\u3001<br \/>\n\u30d1\u30a4\u30ed\u30c3\u30c8\u3055\u3093\u3067\u9a5a\u304d\u307e\u3057\u305f\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 9.x\u3001React\u3001Inertia.js\u3001Vite<\/p>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:controller TwoStepsValidationController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Http\/Controllers\/TwoStepsValidationController.php<\/strong><\/p>\n<pre><strong>&lt;?php<\/strong>\r\n\r\n<strong>namespace App\\Http\\Controllers;<\/strong>\r\n\r\n<strong>use Illuminate\\Http\\Request;<\/strong>\r\n<strong>use Inertia\\Inertia;<\/strong>\r\n\r\n<strong>class TwoStepsValidationController extends Controller<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    public function create()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return Inertia::render('TwoStepsValidation\/Create');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function preStore(Request $request)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $request-&gt;validate([ \/\/ \u4e8b\u524d\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/strong>\r\n<strong>            'title' =&gt; 'required',<\/strong>\r\n<strong>            'description' =&gt; 'required',<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>        return redirect()-&gt;route('two_steps_validation.create');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function store(Request $request)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $request-&gt;validate([ \/\/ \u672c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/strong>\r\n<strong>            'title' =&gt; 'required',<\/strong>\r\n<strong>            'description' =&gt; 'required',<\/strong>\r\n<strong>            'file' =&gt; ['required', 'file', 'max:2048'],<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>        \/\/ \u3053\u3053\u3067\u4fdd\u5b58\u51e6\u7406\u3092\u884c\u3046<\/strong>\r\n\r\n<strong>        return redirect()-&gt;route('two_steps_validation.create');<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>create()\u3000\u30fb\u30fb\u30fb\u3000\u9001\u4fe1\u30d5\u30a9\u30fc\u30e0\u306e\u8868\u793a<\/li>\n<li>preStore()\u3000\u30fb\u30fb\u30fb\u3000\u4e8b\u524d\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/li>\n<li>store\u3000\u30fb\u30fb\u30fb\u3000\u672c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff08\uff06\u4fdd\u5b58\uff09<\/li>\n<\/ul>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u7d9a\u3044\u3066\u5148\u307b\u3069<code>create()<\/code>\u5185\u3067\u30bb\u30c3\u30c8\u3057\u305f\u30d3\u30e5\u30fc\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff09\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><strong>resources\/js\/Pages\/TwoStepsValidation\/Create.jsx<\/strong><\/p>\n<pre><strong>import React, {useState, useRef} from 'react';<\/strong>\r\n<strong>import {Inertia} from \"@inertiajs\/inertia\";<\/strong>\r\n\r\n<strong>export default function Create(props) {<\/strong>\r\n\r\n<strong>    \/\/ Data<\/strong>\r\n<strong>    const [title, setTitle] = useState('');<\/strong>\r\n<strong>    const [description, setDescription] = useState('');<\/strong>\r\n<strong>    const [file, setFile] = useState(null);<\/strong>\r\n<strong>    const errors = props.errors;<\/strong>\r\n\r\n<strong>    \/\/ Refs<\/strong>\r\n<strong>    const inputFileRef = useRef();<\/strong>\r\n\r\n<strong>    \/\/ Handlers<\/strong>\r\n<strong>    const handleFileChange = e =&gt; {<\/strong>\r\n\r\n<strong>        setFile(e.target.files[0]);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const handlePreSubmit = () =&gt; {<\/strong>\r\n\r\n<strong>        const url = route('two_steps_validation.pre_store');<\/strong>\r\n<strong>        const data = { \/\/ \u30d5\u30a1\u30a4\u30eb\u4ee5\u5916\u306e\u30c7\u30fc\u30bf\u9001\u4fe1<\/strong>\r\n<strong>            title,<\/strong>\r\n<strong>            description,<\/strong>\r\n<strong>        };<\/strong>\r\n\r\n<strong>        Inertia.post(url, data, {<\/strong>\r\n<strong>            onSuccess() {<\/strong>\r\n\r\n<strong>                handleSubmit(); \/\/ \u672c\u9001\u4fe1<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        });<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const handleSubmit = () =&gt; {<\/strong>\r\n\r\n<strong>        const url = route('two_steps_validation.store');<\/strong>\r\n<strong>        const data = { \/\/ \u5168\u30c7\u30fc\u30bf\u9001\u4fe1<\/strong>\r\n<strong>            title,<\/strong>\r\n<strong>            description,<\/strong>\r\n<strong>            file,<\/strong>\r\n<strong>        };<\/strong>\r\n\r\n<strong>        Inertia.post(url, data, {<\/strong>\r\n<strong>            forceFormData: true, \/\/ \u5fc5\u305a FormData \u3067\u9001\u4fe1<\/strong>\r\n<strong>            onSuccess() {<\/strong>\r\n\r\n<strong>                setTitle('');<\/strong>\r\n<strong>                setDescription('');<\/strong>\r\n<strong>                setFile(null);<\/strong>\r\n<strong>                inputFileRef.current.value = null; \/\/ \u30d5\u30a1\u30a4\u30eb\u9078\u629e\u3092\u30af\u30ea\u30a2<\/strong>\r\n\r\n<strong>                alert('\u5b8c\u4e86\u3057\u307e\u3057\u305f');<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        });<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"w-48 p-5\"&gt;<\/strong>\r\n<strong>            &lt;div className=\"mb-6\"&gt;<\/strong>\r\n<strong>                &lt;label className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\"&gt;<\/strong>\r\n<strong>                    \u30bf\u30a4\u30c8\u30eb<\/strong>\r\n<strong>                &lt;\/label&gt;<\/strong>\r\n<strong>                &lt;input<\/strong>\r\n<strong>                    type=\"text\"<\/strong>\r\n<strong>                    value={title}<\/strong>\r\n<strong>                    className=\"border border-gray-300 text-gray-900 text-sm\"<\/strong>\r\n<strong>                    onChange={e =&gt; setTitle(e.target.value)} \/&gt;<\/strong>\r\n<strong>                {errors.title &amp;&amp; &lt;p className=\"text-red-500 text-xs italic\"&gt;{errors.title}&lt;\/p&gt;}<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div className=\"mb-6\"&gt;<\/strong>\r\n<strong>                &lt;label className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\"&gt;<\/strong>\r\n<strong>                    \u5185\u5bb9<\/strong>\r\n<strong>                &lt;\/label&gt;<\/strong>\r\n<strong>                &lt;textarea<\/strong>\r\n<strong>                    value={description}<\/strong>\r\n<strong>                    className=\"border border-gray-300 text-gray-900 text-sm\"<\/strong>\r\n<strong>                    onChange={e =&gt; setDescription(e.target.value)} \/&gt;<\/strong>\r\n<strong>                {errors.description &amp;&amp; &lt;p className=\"text-red-500 text-xs italic\"&gt;{errors.description}&lt;\/p&gt;}<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div className=\"mb-6\"&gt;<\/strong>\r\n<strong>                &lt;label className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\"&gt;<\/strong>\r\n<strong>                    \u5bb9\u91cf\u304c\u5927\u304d\u3044\u30d5\u30a1\u30a4\u30eb<\/strong>\r\n<strong>                &lt;\/label&gt;<\/strong>\r\n<strong>                &lt;input<\/strong>\r\n<strong>                    ref={inputFileRef}<\/strong>\r\n<strong>                    type=\"file\"<\/strong>\r\n<strong>                    onChange={e =&gt; handleFileChange(e)} \/&gt;<\/strong>\r\n<strong>                {errors.file &amp;&amp; &lt;p className=\"text-red-500 text-xs italic\"&gt;{errors.file}&lt;\/p&gt;}<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;button<\/strong>\r\n<strong>                type=\"button\"<\/strong>\r\n<strong>                className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-4 py-2.5 text-center\"<\/strong>\r\n<strong>                onClick={() =&gt; handlePreSubmit()}&gt;<\/strong>\r\n<strong>                \u9001\u4fe1\u3059\u308b<\/strong>\r\n<strong>            &lt;\/button&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u901a\u5e38\u306e\u91cd\u8981\u306a\u306e\u304c\u3001\u300c<strong>\u30d5\u30a1\u30a4\u30eb\u9078\u629e<\/strong>\u300d\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u306f\u901a\u5e38\u306e\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3068\u306f\u9055\u3044\u3001\u4ee5\u4e0b\u306e\u4f5c\u696d\u3092\u81ea\u5206\u3067\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u9078\u629e\u3055\u308c\u305f\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\uff06\u30c7\u30fc\u30bf\u683c\u7d0d\u3059\u308b<\/li>\n<li>\u9001\u4fe1\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u9078\u629e\u6e08\u307f\u30d5\u30a1\u30a4\u30eb\u3092\u30af\u30ea\u30a2\u3059\u308b<\/li>\n<\/ol>\n<p>\u306a\u304a\u3001\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u306e\u30af\u30ea\u30a2\u306f\u76f4\u63a5<code>&lt;input&gt;<\/code>\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046<code>useRef()<\/code>\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u304c\u3001<code>inputFileRef.<strong>current<\/strong>.value = null;<\/code>\u3068\u3001<code>current<\/code>\u304c\u5fc5\u8981\u306a\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u6700\u5f8c\u306b\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>use App\\Http\\Controllers\\TwoStepsValidationController;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>Route::prefix('two_steps_validation')-&gt;controller(TwoStepsValidationController::class)-&gt;group(function(){<\/strong>\r\n\r\n<strong>    Route::get('\/create', 'create')-&gt;name('two_steps_validation.create');<\/strong>\r\n<strong>    Route::post('\/pre', 'preStore')-&gt;name('two_steps_validation.pre_store');<\/strong>\r\n<strong>    Route::post('\/', 'store')-&gt;name('two_steps_validation.store');<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u2728\ud83d\ude0a\ud83d\udc4d<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p><code>Vite<\/code>\u3092\u8d77\u52d5\u5f8c\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u3001\u300c<strong>http:\/\/******\/two_steps_validation\/create<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u307e\u305a\u306f\u4f55\u3082\u5165\u529b\u305b\u305a\u300c<strong>\u9001\u4fe1\u3059\u308b<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10900\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_1.png\" alt=\"\" width=\"322\" height=\"368\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_1.png 322w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_1-263x300.png 263w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10901\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_2.png\" alt=\"\" width=\"328\" height=\"419\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_2.png 328w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_2-235x300.png 235w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\uff12\u6bb5\u968e\u3067\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u306e\u3067\u3001\u307e\u305a\u306f\u300c<strong>\u30bf\u30a4\u30c8\u30eb<\/strong>\u300d\u3068\u300c<strong>\u5185\u5bb9<\/strong>\u300d\u306e\uff12\u3064\u3060\u3051\u306b\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u6b21\u306b\u300c<strong>\u30bf\u30a4\u30c8\u30eb<\/strong>\u300d\u3068\u300c<strong>\u5185\u5bb9<\/strong>\u300d\u306f\u5165\u529b\u3057\u307e\u3059\u304c\u3001\u30d5\u30a1\u30a4\u30eb\u306f\u7a7a\u306e\u307e\u307e\u3067\u9001\u4fe1\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10902\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_3.png\" alt=\"\" width=\"325\" height=\"386\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_3.png 325w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_3-253x300.png 253w\" sizes=\"auto, (max-width: 325px) 100vw, 325px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u5148\u307b\u3069\u306f\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30c1\u30a7\u30c3\u30af\u3055\u308c\u306a\u304b\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u306b\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\u306d\ud83d\ude0a\u2728<\/p>\n<p>\u3067\u306f\u3001\u6298\u89d2\u3067\u3059\u306e\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u3066\u9001\u4fe1\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3046\u307e\u304f\u3044\u304f\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10903\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_4.png\" alt=\"\" width=\"480\" height=\"195\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_4.png 480w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_4-300x122.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u5b8c\u4e86\u3092\u77e5\u3089\u305b\u308b\u30a2\u30e9\u30fc\u30c8\u304c\u8868\u793a\u3055\u308c\u3066\u3001\u3055\u3089\u306b\u30d5\u30a9\u30fc\u30e0\u304c\u521d\u671f\u72b6\u614b\u306b\u623b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10900\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_1.png\" alt=\"\" width=\"322\" height=\"368\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_1.png 322w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_react_two_steps_validation_1-263x300.png 263w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/p>\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306e\u3088\u3046\u306b\u30b5\u30a4\u30ba\u306e\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u9001\u4fe1\u3059\u308b\u5834\u5408\u306f\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u5206\u5272\u3059\u308b\u3053\u3068\u3067\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u300c<strong>\u3061\u3087\u3063\u3068\u3057\u305f\u914d\u616e<\/strong>\u300d\u3092\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3084\u30b7\u30b9\u30c6\u30e0\u306b\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u3088\u308a\u4f7f\u3044\u3084\u3059\u304f\u306a\u308a\u3001\u4f5c\u696d\u52b9\u7387\u3084\u6e80\u8db3\u5ea6\u3092\u3042\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u305d\u3046\u3044\u3063\u305f\u6539\u5584\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u3001\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u304a\u6c17\u8efd\u306b\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002m(_ _)m<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel + React<\/code>\u3092\u4f7f\u3063\u305f\u300c<strong>\uff12\u6bb5\u968e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/strong>\u300d\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u76f4\u8fd1\u306e<code>React<\/code>\u8a18\u4e8b\u306f\uff14\u3064\u3081\u3067\u3059\u304c\u3001<code>ref<\/code>\u306a\u3069<code>Vue<\/code>\u3068\u5171\u901a\u3059\u308b\u90e8\u5206\u304c\u591a\u3044\u306e\u3067\u3001\u7d50\u69cb\u3059\u3093\u306a\u308a\u3068\u5b9f\u88c5\u3067\u304d\u30db\u30c3\u3068\u3057\u3066\u3044\u307e\u3059\uff08\u6b63\u76f4<code>React<\/code>\u306f\u30de\u30b7\u3067\u3057\u305f\u304c\u3001\u305d\u306e\u6614\u306e<code>Angular<\/code>\u306e\u82e6\u624b\u610f\u8b58\u304c\u8607\u3063\u3066\u304d\u305f\u3093\u3067\u3059\u3088\u306d\u2026\ud83d\ude02\uff09<\/p>\n<p>\u3084\u306f\u308a\u8a2d\u8a08\u601d\u60f3\u306f\u9055\u3048\u3069\u3001\u5411\u304b\u3063\u3066\u3044\u308b\u65b9\u5411\u306f\u540c\u3058\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u4eca\u5f8c\u3082\u958b\u767a\u306e\u4e16\u754c\u304b\u3089\u76ee\u304c\u96e2\u305b\u307e\u305b\u3093\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6071 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/>\u300c\u3053\u306e\u524d\u3001\u56fd\u7523\u30d3\u30fc\u30eb\u767a\u7965\u306e\u5730<br \/>\n\uff08\u5317\u65b0\u5730\uff09\u306b\u884c\u3063\u3066\u304d\u307e\u3057\u305f\ud83c\udf7a\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u308c\u306f\u5b9f\u969b\u306b\u79c1\u304c\u4f7f\u3063\u3066\u307f\u3066\u300c\u3046\u30fc\u3093\u2026\u300d\u3068\u306a\u3063\u305f\u8a71\u306a\u306e\u3067\u3059\u304c\u3001\u5c11\u3057\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306b\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002 \u30d5\u30a1\u30a4\u30eb\u4ee5\u5916\u306e\u30c7\u30fc &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=10899\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + React \u3067\uff12\u6bb5\u968e\u300c\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u300d\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":10907,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,118,248],"tags":[],"class_list":["post-10899","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-inertia-js","category-laravel","category-react-js","category-vite"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10899","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=10899"}],"version-history":[{"count":3,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10899\/revisions"}],"predecessor-version":[{"id":10906,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10899\/revisions\/10906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/10907"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}