{"id":1004,"date":"2024-04-16T07:41:18","date_gmt":"2024-04-15T22:41:18","guid":{"rendered":"http:\/\/inwelly.com\/?p=1004"},"modified":"2024-04-16T07:41:18","modified_gmt":"2024-04-15T22:41:18","slug":"php-laravel-6-crud-%ea%b8%b0%eb%b3%b8-%eb%aa%a9%eb%a1%9d-%ed%99%95%ec%9d%b8-3","status":"publish","type":"post","link":"https:\/\/inwelly.com\/?p=1004","title":{"rendered":"PHP Laravel 6 &#8211; CRUD \uae30\ubcf8 : \ubaa9\ub85d , \ud655\uc778 (3)\u00a0"},"content":{"rendered":"\n<p>&#8211; \ubaa9\ub85d \ud654\uba74 ( \ud3b8\uc9d1 \ud30c\uc77c : TestCRUDController )<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>publicfunctionindex()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>$test&nbsp;=&nbsp;TestCRUD::all();<\/p>\n\n\n\n<p>return&nbsp;view(&#8216;test_view.index&#8217;,&nbsp;compact(&#8216;test&#8217;));<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; View \ud30c\uc77c \uc0dd\uc131 (\u00a0\/resources\/views\/test_view\u00a0)\u00a0\u00a0index.blade.php<\/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;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;List&nbsp;test&nbsp;crud&lt;\/h1&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;@if(session()-&gt;get(&#8216;success&#8217;))<\/p>\n\n\n\n<p>&lt;divclass=&#8221;alert&nbsp;alert-success&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{&nbsp;session()-&gt;get(&#8216;success&#8217;)&nbsp;}}&nbsp;&nbsp;<\/p>\n\n\n\n<p>&lt;\/div&gt;&lt;br\/&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;@endif<\/p>\n\n\n\n<p>&lt;tableclass=&#8221;table&nbsp;table-striped&#8221;&gt;<\/p>\n\n\n\n<p>&lt;thead&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;Title&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;description&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;tdcolspan=&#8221;2&#8243;&gt;\uae30\ub2a5&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;\/thead&gt;<\/p>\n\n\n\n<p>&lt;tbody&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@foreach($test&nbsp;as&nbsp;$column)<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td&gt;{{$column-&gt;id}}&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;{{$column-&gt;title}}&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;{{$column-&gt;description}}&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@endforeach<\/p>\n\n\n\n<p>&lt;\/tbody&gt;<\/p>\n\n\n\n<p>&lt;\/table&gt;<\/p>\n\n\n\n<p>&lt;\/table&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; \ud655\uc778 : \ubaa9\ub85d(\uba54\uc778) \ud654\uba74<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"781\" height=\"347\" src=\"http:\/\/inwelly.com\/wp-content\/uploads\/2024\/04\/image-491.png\" alt=\"\" class=\"wp-image-1005\" style=\"width:930px;height:auto\"\/><\/figure>\n\n\n\n<p>&#8211; \ubaa9\ub85d &#8220;\uae30\ub2a5&#8221;&nbsp; \ud56d\ubaa9\uc5d0 \ubc84\ud2bc &#8220;\ud655\uc778&#8221; , &#8220;\uc218\uc815&#8221;, &#8220;\uc0ad\uc81c&#8221; \ub97c \ub123\ub294\ub2e4.<\/p>\n\n\n\n<p>&gt; \ud30c\uc77c \ud3b8\uc9d1 (TestCRUDController )<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>publicfunctionshow($id)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>$test&nbsp;=&nbsp;TestCRUD::find($id);<\/p>\n\n\n\n<p>returnview(&#8216;test_view.view&#8217;,&nbsp;compact(&#8216;test&#8217;));<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n<\/blockquote>\n\n\n\n<p>> \ud30c\uc77c \uc0dd\uc131 (\u00a0\/resources\/views\/test_view\u00a0)\u00a0view.blade.php<\/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>&nbsp;&nbsp;&nbsp;&nbsp;View&nbsp;&#8211;&nbsp;Test&nbsp;C.R.U.D&nbsp;<\/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;divclass=&#8221;form-group&#8221;&gt;<\/p>\n\n\n\n<p>&lt;labelfor=&#8221;name&#8221;&gt;Title:&lt;\/label&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{&nbsp;$test-&gt;title&nbsp;}}<\/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;iurl&#8221;&gt;Description&nbsp;:&lt;\/label&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{&nbsp;$test-&gt;description&nbsp;}}<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;ahref=&#8221;{{&nbsp;route(&#8216;test_crud.index&#8217;)}}&#8221;class=&#8221;btn&nbsp;btn-primary&#8221;&gt;\ubaa9\ub85d&lt;\/a&gt;<br><\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;\/div&gt;<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; \ud3b8\uc9d1 ( index.blade.php )\u00a0<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&lt;tableclass=&#8221;table&nbsp;table-striped&#8221;&gt;<\/p>\n\n\n\n<p>&lt;thead&gt;<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;Title&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;description&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;tdcolspan=&#8221;3&#8243;&gt;\uae30\ub2a5&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&lt;\/thead&gt;<\/p>\n\n\n\n<p>&lt;tbody&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@foreach($test&nbsp;as&nbsp;$column)<\/p>\n\n\n\n<p>&lt;tr&gt;<\/p>\n\n\n\n<p>&lt;td&gt;{{$column-&gt;id}}&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;{{$column-&gt;title}}&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;{{$column-&gt;description}}&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;a&nbsp;href=&#8221;{{&nbsp;route(&#8216;test_crud.show&#8217;,&nbsp;$column-&gt;id)}}&#8221;&nbsp;class=&#8221;btn&nbsp;btn-primary&#8221;&gt;\ud655\uc778&lt;\/a&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;td&gt;&lt;\/td&gt;<\/p>\n\n\n\n<p>&lt;\/tr&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@endforeach<\/p>\n\n\n\n<p>&lt;\/tbody&gt;<\/p>\n\n\n\n<p>&lt;\/table&gt;<\/p>\n<\/blockquote>\n\n\n\n<p>&#8211; \ud655\uc778 : \uc6f9 \ud654\uba74\uc5d0\uc11c \ud655\uc778\u00a0<\/p>\n\n\n\n<p>> 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=\"832\" height=\"446\" src=\"http:\/\/inwelly.com\/wp-content\/uploads\/2024\/04\/image-492.png\" alt=\"\" class=\"wp-image-1006\" style=\"width:920px;height:auto\"\/><\/figure>\n\n\n\n<p>> \uc704 \ud654\uba74\uc5d0\uc11c &#8220;\ud655\uc778&#8221; \ubc84\ud2bc\uc744 \ub204\ub974\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=\"865\" height=\"407\" src=\"http:\/\/inwelly.com\/wp-content\/uploads\/2024\/04\/image-493.png\" alt=\"\" class=\"wp-image-1007\" 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>&#8211; \ubaa9\ub85d \ud654\uba74 ( \ud3b8\uc9d1 \ud30c\uc77c : TestCRUDController ) publicfunctionindex() &nbsp;&nbsp;&nbsp;&nbsp;{ $test&nbsp;=&nbsp;TestCRUD::all(); return&nbsp;view(&#8216;test_view.index&#8217;,&nbsp;compact(&#8216;test&#8217;)); &nbsp;&nbsp;&nbsp;&nbsp;} &#8211; View \ud30c\uc77c \uc0dd\uc131 (\u00a0\/resources\/views\/test_view\u00a0)\u00a0\u00a0index.blade.php @extends(&#8216;layout&#8217;) [&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-1004","post","type-post","status-publish","format-standard","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/1004","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=1004"}],"version-history":[{"count":1,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/1004\/revisions"}],"predecessor-version":[{"id":1008,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/1004\/revisions\/1008"}],"wp:attachment":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}