{"id":11009,"date":"2022-10-24T07:00:07","date_gmt":"2022-10-23T22:00:07","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=11009"},"modified":"2022-10-05T18:15:47","modified_gmt":"2022-10-05T09:15:47","slug":"%e3%80%90laravel-react%e3%80%91%e3%82%af%e3%83%aa%e3%83%83%e3%83%97%e3%83%9c%e3%83%bc%e3%83%89%e3%81%ab%e3%82%b3%e3%83%94%e3%83%bc%e3%81%a7%e3%81%8d%e3%82%8b%e3%83%9c%e3%82%bf%e3%83%b3%e3%82%92","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=11009","title":{"rendered":"\u3010Laravel + React\u3011\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001<code>React<\/code>\u304c\u63d0\u4f9b\u3059\u308b<code>Hook<\/code>\u306e\u4fbf\u5229\u3055\u306b\u89e6\u308c\u3066\u611f\u52d5\u3059\u308b\u6bce\u65e5\u3092\u9001\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u3082\u3057\u304b\u3059\u308b\u3068\u3001\u6614<code>React<\/code>\u304c\u4f7f\u3044\u306b\u304f\u3044\u3068\u611f\u3058\u305f\u306e\u306f<code>Hook<\/code>\u304c\u306a\u304b\u3063\u305f\u304b\u3089\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3046\u306a\u308b\u3068\u904e\u53bb\u306b<code>Vue<\/code>\u3084<code>jQuery<\/code>\u3067\u4f5c\u3063\u305f\u6a5f\u80fd\u3082<code>React<\/code>\u3067\u3084\u3063\u3066\u307f\u305f\u304f\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3093\u306a\u3053\u3068\u3082\u3042\u3063\u3066\u4eca\u56de\u306e\u30c6\u30fc\u30de\u306f\u3053\u3061\u3089\u2757<\/p>\n<p><strong style=\"font-size: 35px;\">\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u6a5f\u80fd\u3068\u3057\u3066\u306f\u300c<strong>\u30c6\u30ad\u30b9\u30c8\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3057\u3001\u8cbc\u308a\u4ed8\u3051\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/strong>\u300d\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u304c\u3001\u3053\u3046\u3044\u3063\u305f\u6a5f\u80fd\u306f\u4fbf\u5229\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u6211\u3005\u958b\u767a\u8005\u304c\u3088\u304f\u898b\u308b\u5834\u9762\u3067\u3044\u3046\u3068\u3001\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u300c<strong>API\u30ad\u30fc<\/strong>\u300d\u3092\u53d6\u5f97\u3059\u308b\u3068\u304d\u304c\u591a\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f<code>Laravel + React<\/code>\u3092\u3064\u304b\u3063\u3066\u300c<strong>\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30dc\u30bf\u30f3<\/strong>\u300d\u3092\u5b9f\u88c5\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\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\ude04\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/>\u300c\u30e1\u30e2\u30ea8 \u2192 16 GB<br \/>\n\u3067\u30d0\u30af\u901fPC\u74b0\u5883\u306b\u2757<br \/>\n\u3082\u3046<code>npm<\/code>\u306f\u6016\u304f\u306a\u3044\ud83d\udc4d\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 9.x\u3001React\u3001Vite\u3001Inertia.js\u3001TailwindCSS<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30eb\u30fc\u30c8\u304b\u3089\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u3082\u3072\u3068\u3064\u3060\u3051\u306a\u306e\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f\u3064\u304f\u3089\u305a\u3001\u7701\u7565\u5f62\u3067\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre><strong>use Inertia\\Inertia;<\/strong>\r\n\r\n<strong>\/\/ \u7701\u7565<\/strong>\r\n\r\n<strong>Route::get('copy_to_clipboard', fn() =&gt; Inertia::render('CopyToClipboard\/Index'));<\/strong><\/pre>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u305d\u3057\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u5b9f\u969b\u306b\u8868\u793a\u3055\u308c\u308b\u90e8\u5206\u306e\u300c<strong>\u30d3\u30e5\u30fc\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff09<\/strong>\u300d\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p><strong>resources\/js\/Pages\/CopyToClipboard\/Index.jsx<\/strong><\/p>\n<pre><strong>import {useState} from 'react';<\/strong>\r\n<strong>import CopyToClipboard from '@\/Components\/CopyToClipboard';<\/strong>\r\n\r\n<strong>export default function Index() {<\/strong>\r\n\r\n<strong>    \/\/ Data<\/strong>\r\n<strong>    const [text1, setText1] = useState('\u30d3\u30fc\u30eb');<\/strong>\r\n<strong>    const [text2, setText2] = useState('\u30ef\u30a4\u30f3');<\/strong>\r\n<strong>    const [text3, setText3] = useState('\u65e5\u672c\u9152');<\/strong>\r\n<strong>    const texts = [text1, text2, text3];<\/strong>\r\n\r\n<strong>    \/\/ Methods<\/strong>\r\n<strong>    const handleClick = () =&gt; {<\/strong>\r\n\r\n<strong>        setText1('\u30e9\u30fc\u30e1\u30f3');<\/strong>\r\n<strong>        setText2('\u30ab\u30ec\u30fc');<\/strong>\r\n<strong>        setText3('\u725b\u4e3c');<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const handleCopy = text =&gt; {<\/strong>\r\n\r\n<strong>        console.log(`\u300c${text}\u300d\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3057\u305f`);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"p-5\"&gt;<\/strong>\r\n\r\n<strong>            &lt;h1 className=\"font-bold mb-5\"&gt;\u3010Laravel + React\u3011\u30af\u30ea\u30c3\u30af\u3067\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30dc\u30bf\u30f3&lt;\/h1&gt;<\/strong>\r\n\r\n<strong>            &lt;small className=\"text-gray-500\"&gt;\u30b3\u30d4\u30fc\u5185\u5bb9&lt;\/small&gt;<\/strong>\r\n<strong>            {texts.map((text, index) =&gt; (<\/strong>\r\n<strong>                &lt;div key={index}&gt;<\/strong>\r\n<strong>                    {index+1}\uff0e{text}<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>            ))}<\/strong>\r\n<strong>            &lt;div className=\"mt-3\"&gt;<\/strong>\r\n<strong>                &lt;a href=\"#\" className=\"underline text-blue-700 text-sm\" onClick={handleClick}&gt;\u30b3\u30d4\u30fc\u5185\u5bb9\u3092\u5909\u66f4&lt;\/a&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n\r\n<strong>            &lt;hr className=\"my-5\" \/&gt;<\/strong>\r\n\r\n<strong>            {\/* \u57fa\u672c *\/}<\/strong>\r\n<strong>            &lt;div className=\"mb-5\"&gt;<\/strong>\r\n<strong>                &lt;CopyToClipboard text={text1} onCopy={text =&gt; handleCopy(text)} \/&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n\r\n<strong>            {\/* \u30af\u30e9\u30b9\u3092\u5909\u66f4 *\/}<\/strong>\r\n<strong>            &lt;div className=\"mb-5\"&gt;<\/strong>\r\n<strong>                &lt;CopyToClipboard<\/strong>\r\n<strong>                    text={text2}<\/strong>\r\n<strong>                    className=\"bg-red-500 text-white font-bold py-1.5 px-2.5 rounded-lg\"<\/strong>\r\n<strong>                    onCopy={text =&gt; handleCopy(text)}&gt;&lt;\/CopyToClipboard&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n\r\n<strong>            {\/* \u30e9\u30d9\u30eb\u3092\u5909\u66f4 *\/}<\/strong>\r\n<strong>            &lt;div className=\"mb-10\"&gt;<\/strong>\r\n<strong>                &lt;CopyToClipboard text={text3} onCopy={text =&gt; handleCopy(text)}&gt;<\/strong>\r\n<strong>                    &lt;small&gt;&amp;#x1F4CB; \u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3078\u30b3\u30d4\u30fc&lt;\/small&gt;<\/strong>\r\n<strong>                &lt;\/CopyToClipboard&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n\r\n<strong>            &lt;input type=\"text\" placeholder=\"\u8cbc\u308a\u4ed8\u3051\u78ba\u8a8d\u7528\" \/&gt;<\/strong>\r\n\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u306a\u304a\u3001\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\u30dc\u30bf\u30f3\u3092\uff13\u3064\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u5171\u901a\u306e\u3082\u306e\u3067\u3059\uff09<\/p>\n<ul>\n<li>\u901a\u5e38\u30dc\u30bf\u30f3<\/li>\n<li>\u30af\u30e9\u30b9\u3092\u5909\u66f4\u3059\u308b\uff08\u8d64\u3044\u30dc\u30bf\u30f3\u3067\u3088\u308a\u30ab\u30fc\u30d6\u304c\u304d\u3064\u3044\u5f62\uff09<\/li>\n<li>\u30dc\u30bf\u30f3\u306e\u30e9\u30d9\u30eb\uff08\u30c6\u30ad\u30b9\u30c8\uff09\u3092\u5909\u66f4\u3057\u3001\u7d75\u6587\u5b57\u3082\u4f7f\u3046<\/li>\n<\/ul>\n<h1>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u3055\u3063\u304d\u306e\u300c<strong>\u30d3\u30e5\u30fc<\/strong>\u300d\u3067\u4f7f\u3063\u305f<code>CopyToClipboard<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u304c\u4eca\u56de\u306e\u30e1\u30a4\u30f3\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p><strong>resources\/js\/Components\/CopyToClipboard.jsx<\/strong><\/p>\n<pre><strong>import {useState} from 'react';<\/strong>\r\n\r\n<strong>export default function CopyToClipboard(props) {<\/strong>\r\n\r\n<strong>    \/\/ Data<\/strong>\r\n<strong>    const copyingText = props.text;<\/strong>\r\n<strong>    const buttonClassNames = props.className || 'bg-blue-500 text-white font-bold py-2 px-4 rounded';<\/strong>\r\n<strong>    const originalButtonLabel = props.children || '\u30b3\u30d4\u30fc\u3059\u308b';<\/strong>\r\n<strong>    const [buttonLabel, setButtonLabel] = useState(originalButtonLabel);<\/strong>\r\n\r\n<strong>    \/\/ Methods<\/strong>\r\n<strong>    const handleClick = () =&gt; {<\/strong>\r\n\r\n<strong>        navigator.clipboard.writeText(copyingText); \/\/ \u6ce8\uff1a https \u3067\u3057\u304b\u4f7f\u3048\u307e\u305b\u3093<\/strong>\r\n<strong>        setButtonLabel('\u5b8c\u4e86\uff01');<\/strong>\r\n\r\n<strong>        setTimeout(() =&gt; {<\/strong>\r\n\r\n<strong>            setButtonLabel(originalButtonLabel);<\/strong>\r\n\r\n<strong>            if(typeof props.onCopy ==='function') {<\/strong>\r\n\r\n<strong>                props.onCopy(copyingText);<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }, 700);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;button className={buttonClassNames} onClick={handleClick}&gt;<\/strong>\r\n<strong>            {buttonLabel}<\/strong>\r\n<strong>        &lt;\/button&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3068\u3066\u3082\u30b3\u30fc\u30c9\u3068\u3057\u3066\u306f\u77ed\u3044\u3067\u3059\u3088\u306d\u3002<br \/>\n\u4eca\u56de\u306f\u300c<strong>\u3053\u3093\u306a\u306b\u77ed\u304f\u3066\u3082\u4fbf\u5229\u306a\u6a5f\u80fd\u304c\u5b9f\u88c5\u3067\u304d\u308b\u3088<\/strong>\u300d\u3068\u3044\u3046\u306e\u3092\u5b9f\u611f\u3057\u3066\u3044\u305f\u3060\u3051\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\ud83d\ude04<\/p>\n<p>\u306a\u304a\u3001\u4e2d\u8eab\u3068\u3057\u3066\u306f\u300c<strong>\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3078\u30b3\u30d4\u30fc\u3059\u308b<\/strong>\u300d\u3060\u3051\u306a\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u3068\u304d\u306b\u30dc\u30bf\u30f3\u306e\u30e9\u30d9\u30eb\uff08\u30c6\u30ad\u30b9\u30c8\uff09\u3092\u5909\u66f4\u3059\u308b\u305f\u3081<code>useState()<\/code>\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u3061\u306a\u307f\u306b<\/h1>\n<p style=\"text-align: left;\">\u3082\u3057<code>http<\/code>\u3067\u3082\u30b3\u30d4\u30fc\u3092\u5b9f\u88c5\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3044\u3002\uff08\u984c\u6750\u306f<code>Vue<\/code>\u3067\u3059\u304c\u3001\u30b3\u30d4\u30fc\u90e8\u5206\u306e\u30ed\u30b8\u30c3\u30af\u306f\u307e\u3063\u305f\u304f\u540c\u3058\u3067\u3059\uff09<\/p>\n<p>\ud83d\udcdd\u00a0<a href=\"https:\/\/blog.capilano-fw.com\/?p=9295\">Vue 3 \u3067\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b<\/a><\/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\uff08\u52d5\u753b\u7248\u306f <a href=\"https:\/\/youtu.be\/ZHfgZs1x9ms\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\uff09<\/p>\n<p>\u307e\u305a<code>Vite<\/code>\u3092\u8d77\u52d5\u3057\u300c<strong>https:\/\/******\/copy_to_clipboard<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002\uff08\u30b3\u30d4\u30fc\u304c\u5fc5\u8981\u306a\u306e\u3067HTTP<strong>S<\/strong>\u3067\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11029\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_1.png\" alt=\"\" width=\"527\" height=\"480\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_1.png 527w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_1-300x273.png 300w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/p>\n<p>\uff13\u3064\u306e\u30dc\u30bf\u30f3\u306e\u8868\u793a\u304c\u9055\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u307e\u3059\ud83d\udc4d<\/p>\n<p>\u3067\u306f\u3001\u6b21\u306b\u4e00\u756a\u4e0a\u306e\u300c<strong>\u30b3\u30d4\u30fc\u3059\u308b<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11028\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_2.png\" alt=\"\" width=\"147\" height=\"67\" \/><\/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-11027\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_3.png\" alt=\"\" width=\"109\" height=\"66\" \/><\/p>\n<p>\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8\u304c\u5909\u308f\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u78ba\u8a8d\u7528\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306b\u300c<strong>Ctrl + V<\/strong>\u300d\u3067\u8cbc\u308a\u4ed8\u3051\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11026\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_4.png\" alt=\"\" width=\"259\" height=\"77\" \/><\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11025\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_5.png\" alt=\"\" width=\"257\" height=\"74\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u4e88\u5b9a\u3057\u3066\u3044\u305f\u3068\u304a\u308a\u300c<strong>\u30d3\u30fc\u30eb<\/strong>\u300d\u304c\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u4fdd\u6301\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u7d9a\u3044\u3066\u300c<strong>\u30b3\u30d4\u30fc\u5185\u5bb9\u3092\u5909\u66f4<\/strong>\u300d\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30b3\u30d4\u30fc\u3059\u308b\u5185\u5bb9\u3092\u5909\u66f4\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11024\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_6.png\" alt=\"\" width=\"181\" height=\"154\" \/><\/p>\n<p>\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11023\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_7.png\" alt=\"\" width=\"147\" height=\"151\" \/><\/p>\n<p>\u306f\u3044\u3001\u8868\u793a\uff08\u5909\u6570\u306e\u4e2d\u8eab\uff09\u304c\u5909\u308f\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\u4eca\u5ea6\u306f\u8d64\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11022\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_8.png\" alt=\"\" width=\"132\" height=\"65\" \/><\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b8c\u4e86\u30dc\u30bf\u30f3\u304c\u51fa\u3066\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11021\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_9.png\" alt=\"\" width=\"95\" height=\"60\" \/><\/p>\n<p>\u30da\u30fc\u30b9\u30c8\u3057\u3066\u307f\u308b\u3068\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11020\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/laravel_react_copy_to_clipboard_10.png\" alt=\"\" width=\"257\" height=\"75\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u4eca\u56de\u306f\u8868\u793a\u5909\u66f4\u5f8c\u306e\uff12\u3064\u3081\u300c<strong>\u30ab\u30ec\u30fc<\/strong>\u300d\u304c\u30b3\u30d4\u30da\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude04\u2728<\/p>\n<h1>\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u7528\u610f\u3057\u307e\u3057\u305f<\/h1>\n<p>\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u7528\u610f\u3057\u307e\u3057\u305f\u3002<br \/>\n\u305c\u3072\u5b9f\u969b\u306b\u89e6\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\ud83d\udc4d<\/p>\n<p>\ud83d\udcdd <strong><a href=\"https:\/\/demo-laravel9x-vite.capilano-fw.com\/copy_to_clipboard\" target=\"_blank\" rel=\"noopener\">\u30c7\u30e2\u30da\u30fc\u30b8<\/a><\/strong><\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306e\u3088\u3046\u306b\u3061\u3087\u3063\u3068\u4fbf\u5229\u306a\u6a5f\u80fd\u3092\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5316\u3057\u3066\u304a\u304f\u3068\u3001\u518d\u5ea6\u540c\u3058\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u3001\u958b\u767a\u3092\u52b9\u7387\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u305d\u3046\u3044\u3063\u305f\u3054\u5e0c\u671b\u304c\u3054\u3056\u3044\u307e\u3057\u305f\u3089\u3001\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306b\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude04\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel + React<\/code>\u3067\u300c<strong>\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3078\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30dc\u30bf\u30f3<\/strong>\u300d\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u4eca\u56de\u306f\u30b3\u30d4\u30fc\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306bhttp<strong>s<\/strong>\u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3057\u305f\u304c\u3001\u305d\u3046\u306a\u308b\u3068<code>Vite<\/code>\u306e\u300c<strong>\u30aa\u30fc\u30c8\u30ea\u30ed\u30fc\u30c9\u6a5f\u80fd<\/strong>\u300d\u304c\u52d5\u304b\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\uff08\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u3082\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u307e\u3057\u305f\uff09<\/p>\n<p>\u3053\u306e\u3042\u305f\u308a\u306f\u4eca\u5f8c\u8abf\u67fb\u3057\u3001\u4f55\u304b\u308f\u304b\u308a\u307e\u3057\u305f\u3089\u5f8c\u65e5\u8ffd\u3063\u3066\u5831\u544a\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\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-3405 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/>\u300c\u59ea\u3063\u5b50\u304c\u304f\u308c\u305f<br \/>\n\u624b\u7d19\u306b\u5fc3\u304b\u3089\u611f\u52d5\ud83d\ude02\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001React\u304c\u63d0\u4f9b\u3059\u308bHook\u306e\u4fbf\u5229\u3055\u306b\u89e6\u308c\u3066\u611f\u52d5\u3059\u308b\u6bce\u65e5\u3092\u9001\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u3082\u3057\u304b\u3059\u308b\u3068\u3001\u6614React\u304c\u4f7f\u3044\u306b\u304f\u3044\u3068\u611f\u3058\u305f\u306e\u306fHook\u304c\u306a\u304b\u3063\u305f\u304b\u3089\u304b\u3082 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=11009\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel + React\u3011\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":11032,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,32,249,248],"tags":[],"class_list":["post-11009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-inertia-js","category-laravel","category-linux","category-tailwind-css","category-vite"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11009","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=11009"}],"version-history":[{"count":8,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11009\/revisions"}],"predecessor-version":[{"id":11031,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11009\/revisions\/11031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/11032"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}