{"id":997,"date":"2024-04-16T05:06:28","date_gmt":"2024-04-15T20:06:28","guid":{"rendered":"http:\/\/inwelly.com\/?p=997"},"modified":"2024-04-16T05:06:28","modified_gmt":"2024-04-15T20:06:28","slug":"php-laravel-6-crud-%ea%b8%b0%eb%b3%b8-with-bootstrap-vue-%eb%93%b1%eb%a1%9d-2","status":"publish","type":"post","link":"https:\/\/inwelly.com\/?p=997","title":{"rendered":"PHP Laravel 6 &#8211; CRUD \uae30\ubcf8 with Bootstrap , Vue &#8211; \ub4f1\ub85d (2)"},"content":{"rendered":"\n<p>2. \ud14c\uc774\ube14\uc5d0 \uac12\uc744 \uc800\uc7a5,\uc77d\uace0,\uc218\uc815,\uc0ad\uc81c \ud560\uc218 \uc788\ub294 \ud30c\uc77c\uc744 \uc0dd\uc131<\/p>\n\n\n\n<p>$&gt;&nbsp;php artisan make:controller TestCRUDController&nbsp; &#8211;resource<br>Controller created successfully.<\/p>\n\n\n\n<p>&#8211; \ud655\uc778&nbsp;<br>$&gt; cd&nbsp; \/app\/Http\/Controllers<br>TestCRUDController.php<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&lt;?php<\/p>\n\n\n\n<p>namespaceApp\\Http\\Controllers;<\/p>\n\n\n\n<p>use&nbsp;Illuminate\\Http\\Request;<\/p>\n\n\n\n<p>classTestCRUDControllerextendsController<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Display&nbsp;a&nbsp;listing&nbsp;of&nbsp;the&nbsp;resource.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;\\Illuminate\\Http\\Response<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/<\/p>\n\n\n\n<p>publicfunctionindex()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>\/\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Show&nbsp;the&nbsp;form&nbsp;for&nbsp;creating&nbsp;a&nbsp;new&nbsp;resource.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;\\Illuminate\\Http\\Response<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/<\/p>\n\n\n\n<p>publicfunctioncreate()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>\/\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Store&nbsp;a&nbsp;newly&nbsp;created&nbsp;resource&nbsp;in&nbsp;storage.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;\\Illuminate\\Http\\Request&nbsp;&nbsp;$request<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;\\Illuminate\\Http\\Response<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/<\/p>\n\n\n\n<p>publicfunctionstore(Request$request)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>\/\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Display&nbsp;the&nbsp;specified&nbsp;resource.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;int&nbsp;&nbsp;$id<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;\\Illuminate\\Http\\Response<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/<\/p>\n\n\n\n<p>publicfunctionshow($id)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>\/\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Show&nbsp;the&nbsp;form&nbsp;for&nbsp;editing&nbsp;the&nbsp;specified&nbsp;resource.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;int&nbsp;&nbsp;$id<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;\\Illuminate\\Http\\Response<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/<\/p>\n\n\n\n<p>publicfunctionedit($id)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>\/\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Update&nbsp;the&nbsp;specified&nbsp;resource&nbsp;in&nbsp;storage.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;\\Illuminate\\Http\\Request&nbsp;&nbsp;$request<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;int&nbsp;&nbsp;$id<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;\\Illuminate\\Http\\Response<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/<\/p>\n\n\n\n<p>publicfunctionupdate(Request$request,&nbsp;$id)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>\/\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Remove&nbsp;the&nbsp;specified&nbsp;resource&nbsp;from&nbsp;storage.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;int&nbsp;&nbsp;$id<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;\\Illuminate\\Http\\Response<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/<\/p>\n\n\n\n<p>publicfunctiondestroy($id)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>\/\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; \uc704 \uc0dd\uc131\ub41c\u00a0 \ud30c\uc77c\uc758 \uc0c1\ub2e8\uc5d0\u00a0model namespace \ub97c import \uc2dc\ud0a8\ub2e4.\u00a0<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&lt;?php<\/p>\n\n\n\n<p>namespaceApp\\Http\\Controllers;<\/p>\n\n\n\n<p>use&nbsp;Illuminate\\Http\\Request;<\/p>\n\n\n\n<p>use&nbsp;App\\TestCRUD;<\/p>\n\n\n\n<p>classTestCRUDControllerextendsController<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>\/**<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; \ud3b8\uc9d1 : \uc6f9\uc5d0 \ucd9c\ub825\ub418\ub294 \ud654\uba74\uc744 \uc544\ub798\uc640 \uac19\uc774 \uc815\uc758\ud55c\ub2e4\u00a0<br>$> cd\u00a0\/routes<br>web.php<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&lt;?php<\/p>\n\n\n\n<p>\/*<\/p>\n\n\n\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p>|&nbsp;Web&nbsp;Routes<\/p>\n\n\n\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p>|<\/p>\n\n\n\n<p>|&nbsp;Here&nbsp;is&nbsp;where&nbsp;you&nbsp;can&nbsp;register&nbsp;web&nbsp;routes&nbsp;for&nbsp;your&nbsp;application.&nbsp;These<\/p>\n\n\n\n<p>|&nbsp;routes&nbsp;are&nbsp;loaded&nbsp;by&nbsp;the&nbsp;RouteServiceProvider&nbsp;within&nbsp;a&nbsp;group&nbsp;which<\/p>\n\n\n\n<p>|&nbsp;contains&nbsp;the&nbsp;&#8220;web&#8221;&nbsp;middleware&nbsp;group.&nbsp;Now&nbsp;create&nbsp;something&nbsp;great!<\/p>\n\n\n\n<p>|<\/p>\n\n\n\n<p>*\/<\/p>\n\n\n\n<p>Route::get(&#8216;\/&#8217;,&nbsp;function&nbsp;()&nbsp;{<\/p>\n\n\n\n<p>returnview(&#8216;welcome&#8217;);<\/p>\n\n\n\n<p>});<\/p>\n<\/blockquote>\n\n\n\n<p>\uc704 \ub0b4\uc6a9\uc744 \uc544\ub798\uc640 \uac19\uc774 \ud3b8\uc9d1 \ud55c\ub2e4.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&lt;?php<\/p>\n\n\n\n<p>\/*<\/p>\n\n\n\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p>|&nbsp;Web&nbsp;Routes<\/p>\n\n\n\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p>|<\/p>\n\n\n\n<p>|&nbsp;Here&nbsp;is&nbsp;where&nbsp;you&nbsp;can&nbsp;register&nbsp;web&nbsp;routes&nbsp;for&nbsp;your&nbsp;application.&nbsp;These<\/p>\n\n\n\n<p>|&nbsp;routes&nbsp;are&nbsp;loaded&nbsp;by&nbsp;the&nbsp;RouteServiceProvider&nbsp;within&nbsp;a&nbsp;group&nbsp;which<\/p>\n\n\n\n<p>|&nbsp;contains&nbsp;the&nbsp;&#8220;web&#8221;&nbsp;middleware&nbsp;group.&nbsp;Now&nbsp;create&nbsp;something&nbsp;great!<\/p>\n\n\n\n<p>|<\/p>\n\n\n\n<p>*\/<\/p>\n\n\n\n<p>Route::get(&#8216;\/&#8217;,&nbsp;function&nbsp;()&nbsp;{<\/p>\n\n\n\n<p>returnview(&#8216;welcome&#8217;);<\/p>\n\n\n\n<p>});<\/p>\n\n\n\n<p>Route::resource(&#8216;test_crud&#8217;,&nbsp;&#8216;TestCRUDController&#8217;);<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; \ud655\uc778 : \uc6f9 \ube0c\ub77c\uc6b0\uc838\uc5d0\uc11c \uc544\ub798\uc640 \uac19\uc774 \uc2e4\ud589\ud574\ubcf8\ub2e4\u00a0 ( http:\/\/\ub3c4\uba54\uc778\/test_crud )<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1093\" height=\"409\" src=\"http:\/\/inwelly.com\/wp-content\/uploads\/2024\/04\/image-487.png\" alt=\"\" class=\"wp-image-998\" style=\"width:920px;height:auto\"\/><\/figure>\n\n\n\n<p>&#8211;&nbsp;Bootstrap and Vue \uc0ac\uc6a9\uc744 \uc704\ud574 \uc544\ub798 \uba85\ub839\uc744 \uc2e4\ud589<br>$&gt; composer require laravel\/ui &#8211;dev<\/p>\n\n\n\n<p>Using version ^1.1 for laravel\/ui<\/p>\n\n\n\n<p>.\/composer.json has been updated<\/p>\n\n\n\n<p>Loading composer repositories with package information<\/p>\n\n\n\n<p>Updating dependencies (including require-dev)<\/p>\n\n\n\n<p>Package operations: 1 install, 0 updates, 0 removals<\/p>\n\n\n\n<p>&nbsp; &#8211; Installing laravel\/ui (v1.1.2): Loading from cache<\/p>\n\n\n\n<p>Writing lock file<\/p>\n\n\n\n<p>Generating optimized autoload files<\/p>\n\n\n\n<p>&gt; Illuminate\\Foundation\\ComposerScripts::postAutoloadDump<\/p>\n\n\n\n<p>&gt; @php artisan package:discover &#8211;ansi<\/p>\n\n\n\n<p>Discovered Package: facade\/ignition<\/p>\n\n\n\n<p>Discovered Package: fideloper\/proxy<\/p>\n\n\n\n<p>Discovered Package: laravel\/tinker<\/p>\n\n\n\n<p>Discovered Package: laravel\/ui<\/p>\n\n\n\n<p>Discovered Package: nesbot\/carbon<\/p>\n\n\n\n<p>Discovered Package: nunomaduro\/collision<\/p>\n\n\n\n<p>Package manifest generated successfully.<\/p>\n\n\n\n<p>&#8211; \uc544\ub798 \uba85\ub839\uc744 \ud1b5\ud574 vue \uc640 react \ub97c Frontend \ud654\uba74\uc5d0\uc11c \uc0ac\uc6a9 \ud560\uc218\uc788\ub3c4\ub85d \ud55c\ub2e4.<\/p>\n\n\n\n<p>&gt; vue , react \uc758 \uc77c\ubc18\uc801\uc778 \uc0ac\uc6a9\uc2dc&nbsp;<\/p>\n\n\n\n<p>$&gt; php artisan ui vue<\/p>\n\n\n\n<p>$&gt; php artisan ui react<\/p>\n\n\n\n<p>&gt; vue , react \uc758 \ub85c\uadf8\uc778\uacfc \ud68c\uc6d0\uac00\uc785 \uc0ac\uc6a9\uc2dc<\/p>\n\n\n\n<p>$&gt; php artisan ui vue &#8211;auth<\/p>\n\n\n\n<p>$&gt; php artisan ui react &#8211;auth<\/p>\n\n\n\n<p>( \ucc38\uc870 : \ub0b4 \uacbd\uc6b0\uc5d0\ub294 \uc704 4\uac00\uc9c0 \uba85\ub839\uc744 \ubaa8\ub450 \uc2e4\ud589 \uc2dc\ud0b4 )<br>&#8211;&nbsp; blade \ud30c\uc77c\uc744 \uc0dd\uc131<br>$&gt; cd&nbsp;\/resources\/views&nbsp;<\/p>\n\n\n\n<p>\uc0dd\uc131 \ud30c\uc77c &#8211;&nbsp;&nbsp;<strong>layout.blade.php<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&lt;!DOCTYPEhtml&gt;<\/p>\n\n\n\n<p>&lt;htmllang=&#8221;en&#8221;&gt;<\/p>\n\n\n\n<p>&lt;head&gt;<\/p>\n\n\n\n<p>&lt;metacharset=&#8221;UTF-8&#8243;&gt;<\/p>\n\n\n\n<p>&lt;metaname=&#8221;viewport&#8221;content=&#8221;width=device-width,&nbsp;initial-scale=1.0&#8243;&gt;<\/p>\n\n\n\n<p>&lt;metahttp-equiv=&#8221;X-UA-Compatible&#8221;content=&#8221;ie=edge&#8221;&gt;<\/p>\n\n\n\n<p>&lt;title&gt;Laravel&nbsp;6&nbsp;CRUD&nbsp;\uae30\ubcf8&nbsp;sample&lt;\/title&gt;<\/p>\n\n\n\n<p>&lt;linkhref=&#8221;{{&nbsp;asset(&#8216;css\/app.css&#8217;)&nbsp;}}&#8221;rel=&#8221;stylesheet&#8221;type=&#8221;text\/css&#8221;\/&gt;<\/p>\n\n\n\n<p>&lt;\/head&gt;<\/p>\n\n\n\n<p>&lt;body&gt;<\/p>\n\n\n\n<p>&lt;divclass=&#8221;container&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@yield(&#8216;content&#8217;)<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;scriptsrc=&#8221;{{&nbsp;asset(&#8216;js\/app.js&#8217;)&nbsp;}}&#8221;type=&#8221;text\/js&#8221;&gt;&lt;\/script&gt;<\/p>\n\n\n\n<p>&lt;\/body&gt;<\/p>\n\n\n\n<p>&lt;\/html&gt;<\/p>\n<\/blockquote>\n\n\n\n<p>\ud574\ub2f9 \ud3f4\ub354(\/resources\/views )\uc5d0 &#8220;test_view&#8221; \ub77c\ub294 \ud3f4\ub354\ub97c \uc0dd\uc131\ud55c\ub2e4.<br>\uc774\ud6c4\u00a0 test_view \ud3f4\ub354 \uc18d\uc5d0\u00a0<br>\uc0dd\uc131 \ud30c\uc77c &#8211;\u00a0\u00a0insertform.blade.php\u00a0<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>@extends(&#8216;layout&#8217;)<\/p>\n\n\n\n<p>@section(&#8216;content&#8217;)<\/p>\n\n\n\n<p>&lt;style&gt;<\/p>\n\n\n\n<p>.uper&nbsp;{<\/p>\n\n\n\n<p>margin-top:&nbsp;40px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&lt;\/style&gt;<\/p>\n\n\n\n<p>&lt;divclass=&#8221;card&nbsp;uper&#8221;&gt;<\/p>\n\n\n\n<p>&lt;divclass=&#8221;card-header&#8221;&gt;<\/p>\n\n\n\n<p>&lt;h1&gt;Insert&nbsp;form&nbsp;test&nbsp;crud&lt;\/h1&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;divclass=&#8221;card-body&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@if&nbsp;($errors-&gt;any())<\/p>\n\n\n\n<p>&lt;divclass=&#8221;alert&nbsp;alert-danger&#8221;&gt;<\/p>\n\n\n\n<p>&lt;ul&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@foreach&nbsp;($errors-&gt;all()&nbsp;as&nbsp;$error)<\/p>\n\n\n\n<p>&lt;li&gt;{{&nbsp;$error&nbsp;}}&lt;\/li&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@endforeach<\/p>\n\n\n\n<p>&lt;\/ul&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;&lt;br\/&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@endif<\/p>\n\n\n\n<p>&lt;formmethod=&#8221;post&#8221;action=&#8221;{{&nbsp;route(&#8216;test_crud.store&#8217;)&nbsp;}}&#8221;&gt;<\/p>\n\n\n\n<p>&lt;divclass=&#8221;form-group&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@csrf<\/p>\n\n\n\n<p>&lt;labelfor=&#8221;title&#8221;&gt;Title&nbsp;:&lt;\/label&gt;<\/p>\n\n\n\n<p>&lt;inputtype=&#8221;text&#8221;class=&#8221;form-control&#8221;name=&#8221;title&#8221;\/&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;divclass=&#8221;form-group&#8221;&gt;<\/p>\n\n\n\n<p>&lt;labelfor=&#8221;description&#8221;&gt;Description&nbsp;:&lt;\/label&gt;<\/p>\n\n\n\n<p>&lt;textareaclass=&#8221;form-control&#8221;aria-label=&#8221;With&nbsp;textarea&#8221;name=&#8221;description&#8221;&gt;&lt;\/textarea&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;buttontype=&#8221;submit&#8221;class=&#8221;btn&nbsp;btn-primary&#8221;&gt;INSERT&lt;\/button&gt;<\/p>\n\n\n\n<p>&lt;\/form&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>@endsection<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; \ucee8\ud2b8\ub864 \ud30c\uc77c(TestCRUDController) \ud3b8\uc9d1 \uc544\ub798 \ucc38\uc870<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>publicfunctioncreate()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>returnview(&#8216;test_view.insertform&#8217;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; \ud655\uc778 : \uc6f9\ube0c\ub77c\uc6b0\uc838\uc5d0\uc11c \uc2e4\ud589 ( http:\/\/\ub3c4\uba54\uc778\/test_crud\/create )<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1011\" height=\"501\" src=\"http:\/\/inwelly.com\/wp-content\/uploads\/2024\/04\/image-488.png\" alt=\"\" class=\"wp-image-999\" style=\"width:920px;height:auto\"\/><\/figure>\n\n\n\n<p>&#8211;\u00a0 \ub4f1\ub85d\u00a0 DB \uc758 \ud14c\uc774\ube14\uc5d0 \uac12\uc744 \uc800\uc7a5\uc2dc \ud655\uc778\u00a0 ( \ud3b8\uc9d1 \ud30c\uc77c : TestCRUDController\u00a0\u00a0)<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>publicfunctionstore(Request$request)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>$validatedData&nbsp;=&nbsp;$request-&gt;validate([<\/p>\n\n\n\n<p>&#8216;title&#8217;&nbsp;=&gt;&nbsp;&#8216;required|max:100&#8217;,<\/p>\n\n\n\n<p>&#8216;description&#8217;&nbsp;=&gt;&nbsp;&#8216;required&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]);<\/p>\n\n\n\n<p>$test&nbsp;=&nbsp;TestCRUD::create($validatedData);<\/p>\n\n\n\n<p>returnredirect(&#8216;\/test_crud&#8217;)-&gt;with(&#8216;success&#8217;,&nbsp;&#8216;test&nbsp;is&nbsp;successfully&nbsp;saved&#8217;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211;\u00a0 \uc785\ub825\uc744 \ud558\uc9c0 \uc54a\uace0\u00a0 &#8220;INSERT&#8221; \ubc84\ud2bc \ub20c\ub7ec \uc2e4\ud589\ud558\uba74 \uc544\ub798\uc640 \uac19\uc774 \ub428<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"849\" height=\"540\" src=\"http:\/\/inwelly.com\/wp-content\/uploads\/2024\/04\/image-489.png\" alt=\"\" class=\"wp-image-1000\" style=\"width:920px;height:auto\"\/><\/figure>\n\n\n\n<p>&#8211; \uc704 form \uac12\uc744 \uc815\uc0c1\uc801\uc73c\ub85c \ub123\uace0 \uc2e4\ud589\uc2dc\ud0a4\uba74 \uc544\ub798\uc640 \uac19\uc774 DB \uc758 \ud14c\uc774\ube14 \uacb0\uacfc\ub97c \uc5bb\uc744\uc218 \uc788\uc74c<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"572\" height=\"130\" src=\"http:\/\/inwelly.com\/wp-content\/uploads\/2024\/04\/image-490.png\" alt=\"\" class=\"wp-image-1001\" style=\"width:920px;height:auto\"\/><\/figure>\n\n\n\n<p>\uc18c\uc2a4 :\u00a0<a href=\"https:\/\/github.com\/nzhongtting\/Laravel_hsh_board\">https:\/\/github.com\/nzhongtting\/Laravel_hsh_board<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2. \ud14c\uc774\ube14\uc5d0 \uac12\uc744 \uc800\uc7a5,\uc77d\uace0,\uc218\uc815,\uc0ad\uc81c \ud560\uc218 \uc788\ub294 \ud30c\uc77c\uc744 \uc0dd\uc131 $&gt;&nbsp;php artisan make:controller TestCRUDController&nbsp; &#8211;resourceController created successfully. &#8211; \ud655\uc778&nbsp;$&gt; cd&nbsp; \/app\/Http\/ControllersTestCRUDController.php &lt;?php [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-997","post","type-post","status-publish","format-standard","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=997"}],"version-history":[{"count":1,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/997\/revisions"}],"predecessor-version":[{"id":1002,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/997\/revisions\/1002"}],"wp:attachment":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}