{"id":5718,"date":"2021-03-22T11:50:14","date_gmt":"2021-03-22T11:50:14","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5718"},"modified":"2021-03-22T11:50:14","modified_gmt":"2021-03-22T11:50:14","slug":"crud-through-ajax-using-laravel-framework","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/","title":{"rendered":"CRUD through AJAX using Laravel framework"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Step 1 : create project folder through command line<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncomposer create-project laravel\/laravel AjaxCrud\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2 : Create Post table and model<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp artisan make:model Posts -m\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">under this :- database\/migrations, you have to put bellow code in your migration file for create Posts table<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/dk5202000\/b49ca49d2dddb1d4b0d486bc5f57ac1b.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">After create &#8220;Posts&#8221; table you should create post model for posts, so first create file in this path app\/Post.php and put bellow content in post.php<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Post model : app\\post.php<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/dk5202000\/1e541236c0cecd78fddb0c256e71af08.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Add Route&nbsp;&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Post route : routes\\web.php<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/dk5202000\/87b978cccd65a1d3094e2e598deb64a8.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Create a new Controllers&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run this command to Create a new Controller<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp artisan make:controller PostController\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Controlllers : app\\http\\controllers\\PostController<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/dk5202000\/527a4408d16e542a8462fbe825eb4917.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5 : Create a new Blade File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>View : resources\\views\\post\\index.blade.php<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/dk5202000\/5acbce99aa57b72bceba6c40928f170d.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Create JS and CSS File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>View : resources\\views\\layouts\\app.blade.php<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/dk5202000\/5a824f7932b04fde8d824c0a93175e7a.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">now in terminal write php artisan serve<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now open browser and paste the following link<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">http:\/\/127.0.0.1:8000\/post<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1 : create project folder through command line Step 2 : Create Post table and model under this :- [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5718","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>CRUD through AJAX using Laravel framework - 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\/crud-through-ajax-using-laravel-framework\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CRUD through AJAX using Laravel framework - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Step 1 : create project folder through command line Step 2 : Create Post table and model under this :- [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-22T11:50:14+00:00\" \/>\n<meta name=\"author\" content=\"Deepak K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Deepak K\" \/>\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\\\/crud-through-ajax-using-laravel-framework\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/\"},\"author\":{\"name\":\"Deepak K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/92f6c421a478799fed7f4ab29dea6da3\"},\"headline\":\"CRUD through AJAX using Laravel framework\",\"datePublished\":\"2021-03-22T11:50:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/\"},\"wordCount\":143,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/\",\"name\":\"CRUD through AJAX using Laravel framework - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2021-03-22T11:50:14+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/92f6c421a478799fed7f4ab29dea6da3\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/crud-through-ajax-using-laravel-framework\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CRUD through AJAX using Laravel framework\"}]},{\"@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\\\/92f6c421a478799fed7f4ab29dea6da3\",\"name\":\"Deepak K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8ac4c8929d7142223954f0040f6c4f2ebc4cf11dd62b553c16bef21610494e65?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8ac4c8929d7142223954f0040f6c4f2ebc4cf11dd62b553c16bef21610494e65?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8ac4c8929d7142223954f0040f6c4f2ebc4cf11dd62b553c16bef21610494e65?s=96&d=mm&r=g\",\"caption\":\"Deepak K\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/deepak\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CRUD through AJAX using Laravel framework - 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\/crud-through-ajax-using-laravel-framework\/","og_locale":"en_US","og_type":"article","og_title":"CRUD through AJAX using Laravel framework - scmGalaxy","og_description":"Step 1 : create project folder through command line Step 2 : Create Post table and model under this :- [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/","og_site_name":"scmGalaxy","article_published_time":"2021-03-22T11:50:14+00:00","author":"Deepak K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Deepak K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/"},"author":{"name":"Deepak K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/92f6c421a478799fed7f4ab29dea6da3"},"headline":"CRUD through AJAX using Laravel framework","datePublished":"2021-03-22T11:50:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/"},"wordCount":143,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/","name":"CRUD through AJAX using Laravel framework - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2021-03-22T11:50:14+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/92f6c421a478799fed7f4ab29dea6da3"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/crud-through-ajax-using-laravel-framework\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"CRUD through AJAX using Laravel framework"}]},{"@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\/92f6c421a478799fed7f4ab29dea6da3","name":"Deepak K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8ac4c8929d7142223954f0040f6c4f2ebc4cf11dd62b553c16bef21610494e65?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8ac4c8929d7142223954f0040f6c4f2ebc4cf11dd62b553c16bef21610494e65?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8ac4c8929d7142223954f0040f6c4f2ebc4cf11dd62b553c16bef21610494e65?s=96&d=mm&r=g","caption":"Deepak K"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/deepak\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5718","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\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=5718"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5718\/revisions"}],"predecessor-version":[{"id":5721,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5718\/revisions\/5721"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=5718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=5718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=5718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}