{"id":5630,"date":"2021-03-19T07:41:49","date_gmt":"2021-03-19T07:41:49","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5630"},"modified":"2021-08-05T11:30:36","modified_gmt":"2021-08-05T11:30:36","slug":"laravel-crud-2","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/","title":{"rendered":"LARAVEL CRUD"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong><em>Step 1: make project.<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">composer create -project laravel\/laravel project_name &#8220;version_name.*&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step 2 :Create datbase to php<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Goto web browser and type url localhost\/phpmyadmin and make database<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step 3: Update Database Configuration<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will make database configuration for example database name, username, password etc for our crud application of laravel 5.8.<br>So let&#8217;s open .env file and fill all details like as bellow<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DB_CONNECTION=mysql<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DB_HOST=127.0.0.1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DB_PORT=3306<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DB_DATABASE=here your database name(blog)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DB_USERNAME=here database username(root)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DB_PASSWORD=<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step 4: Link with database<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">php artisan migrate<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step 5: Create Table in database<\/em><\/strong><br>we are going to create crud application for product. so we have to create migration for &#8220;products&#8221; table using Laravel 5.8 php artisan command<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">php artisan make:migration create_products_table &#8211;create=products<\/p>\n\n\n\n\ud83d\udc4d\ud83d\udc4d\ud83d\udc4d\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step  6: migration<\/em><\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/b3755e116a43a1741677df7181678138.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step 7 : View and make blade file<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">first go resources  than view and make blade file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">i . parent.blade.php<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/28431fc5c89eb86686db23ea98b0f4bc.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">ii. create.blade.php<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/e6bdae290eab8ad979a197aa61a04092.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">iii. view.blade.php<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/beb31f88fe44ee02de64ffe08d22d42f.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">iv. edit.blade.php<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/c674d6ace30847d4b02db7836543861d.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">v. index.blade.php<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/729982be6a9e795bd277235df981ff71.js\"><\/script9\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step 8: Controller<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">all function written over here.And calling all blade file in code.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/6b947c9b6cc45bd86a5a40e3abf16412.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Step 9 : Route<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">goto routes and open web.php an make routes<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">i. universal route<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Route::resource ('model_name' , 'Controller_name');<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/5e63124275b9004d9feba8623c964d9c.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">ii. indivisual route<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/ravidev001\/506701e56018d4802fd5a1efde0df4d5.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>Step 1: make project. composer create -project laravel\/laravel project_name &#8220;version_name.*&#8221; Step 2 :Create datbase to php Goto web browser and [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5630","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LARAVEL CRUD - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LARAVEL CRUD - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Step 1: make project. composer create -project laravel\/laravel project_name &#8220;version_name.*&#8221; Step 2 :Create datbase to php Goto web browser and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-19T07:41:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-05T11:30:36+00:00\" \/>\n<meta name=\"author\" content=\"Ravi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ravi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/\"},\"author\":{\"name\":\"Ravi\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0e8d5a206689570c482d51e86f984c5d\"},\"headline\":\"LARAVEL CRUD\",\"datePublished\":\"2021-03-19T07:41:49+00:00\",\"dateModified\":\"2021-08-05T11:30:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/\"},\"wordCount\":191,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/\",\"name\":\"LARAVEL CRUD - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2021-03-19T07:41:49+00:00\",\"dateModified\":\"2021-08-05T11:30:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0e8d5a206689570c482d51e86f984c5d\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-crud-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LARAVEL CRUD\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0e8d5a206689570c482d51e86f984c5d\",\"name\":\"Ravi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a3d749971df1d66a0bc18c82e3102a008970540ed31a36663cabb978ba923342?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a3d749971df1d66a0bc18c82e3102a008970540ed31a36663cabb978ba923342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a3d749971df1d66a0bc18c82e3102a008970540ed31a36663cabb978ba923342?s=96&d=mm&r=g\",\"caption\":\"Ravi\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/ravidev\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LARAVEL CRUD - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/","og_locale":"en_US","og_type":"article","og_title":"LARAVEL CRUD - scmGalaxy","og_description":"Step 1: make project. composer create -project laravel\/laravel project_name &#8220;version_name.*&#8221; Step 2 :Create datbase to php Goto web browser and [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/","og_site_name":"scmGalaxy","article_published_time":"2021-03-19T07:41:49+00:00","article_modified_time":"2021-08-05T11:30:36+00:00","author":"Ravi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ravi","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/"},"author":{"name":"Ravi","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0e8d5a206689570c482d51e86f984c5d"},"headline":"LARAVEL CRUD","datePublished":"2021-03-19T07:41:49+00:00","dateModified":"2021-08-05T11:30:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/"},"wordCount":191,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/","name":"LARAVEL CRUD - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2021-03-19T07:41:49+00:00","dateModified":"2021-08-05T11:30:36+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0e8d5a206689570c482d51e86f984c5d"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-crud-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"LARAVEL CRUD"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0e8d5a206689570c482d51e86f984c5d","name":"Ravi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a3d749971df1d66a0bc18c82e3102a008970540ed31a36663cabb978ba923342?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a3d749971df1d66a0bc18c82e3102a008970540ed31a36663cabb978ba923342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a3d749971df1d66a0bc18c82e3102a008970540ed31a36663cabb978ba923342?s=96&d=mm&r=g","caption":"Ravi"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/ravidev\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=5630"}],"version-history":[{"count":13,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5630\/revisions"}],"predecessor-version":[{"id":5703,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5630\/revisions\/5703"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=5630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=5630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=5630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}