{"id":6015,"date":"2021-05-01T07:42:37","date_gmt":"2021-05-01T07:42:37","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=6015"},"modified":"2021-05-01T12:05:29","modified_gmt":"2021-05-01T12:05:29","slug":"laravel-8-insert-record-using-ajax","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/","title":{"rendered":"Laravel 8 &#8211; Insert record using ajax"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hey friends, I came again to all of you with a new article, must follow below steps to create a CRUD in Laravel using ajax.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 1 : <\/strong>create a Laravel project using below command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">       <code>composer create-project laravel\/laravel Studentsform<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 2<\/strong> : Make a model for this, run below command: after running below command you will find a model name <em>Student<\/em> and one migration <em>2021_05_01_create_students_table<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp artisan make:model Student -m\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 3 :<\/strong> Create a <strong>StudentController<\/strong> now using below command<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp artisan make:controller StudentController\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 4 :<\/strong> Now open <strong>migration<\/strong> and add some column in it<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSchema::create(&#039;students&#039;, function(Blueprint $table)) {\n\t$table-&gt;id();\n\t$table-&gt;string(&#039;firstname&#039;);\n\t$table-&gt;string(&#039;lastname&#039;);\n\t$table-&gt;string(&#039;email&#039;);\n\t$table-&gt;string(&#039;phone&#039;);\n\t$table-&gt;timestamps();\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 5 :<\/strong> Add table name in <strong>Student<\/strong> model and also write fillable area for it with your table <strong>column name<\/strong>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n    protected $table = &#039;students&#039;;\n\tprotected $fillable = &#x5B;&#039;firstname&#039;,&#039;lastname&#039;,&#039;email&#039;,&#039;phone&#039;];\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 6 :<\/strong> now migrate all your <strong>migration<\/strong> using below command , before migrating make sure to create a <strong>Database<\/strong> for it.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp artisan migrate\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 7 : <\/strong>And then Open <strong>StudentController.php<\/strong> (<em>app\/Http\/Controllers\/<\/em>StudentController) and create a function name index().<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\ud83d\udcc4 StudentController.php<\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic function index()\n {\n\t$students = Student::orderBy(&#039;id&#039;,&#039;DESC&#039;)-&gt;get();\n\treturn view(&#039;students&#039;,compact(&#039;students&#039;));\n }\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda<strong> Step 8 :<\/strong>  Let&#8217;s create a route for this. so now open <strong>web.php<\/strong> file situated under <strong>routes <\/strong>folder and add also controller location within <strong>web.php<\/strong>.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\ud83d\udcc4 <strong>web.php<\/strong><\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nUse App\\Http\\Controllers\\StudentController\nRoute::get(&#039;\/students&#039;,&#x5B;StudentController::class,&#039;index&#039;]);\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 9 :<\/strong> Now create a view file under <strong>resources\/views<\/strong> with name <strong>students.blade.php<\/strong> and below code in it<br><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\ud83d\udcc4 students.blade.php <\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;!DOCTYPE html&gt;\n&amp;lt;html lang=&quot;en&quot;&gt;\n&amp;lt;head&gt;\n    &amp;lt;meta charset=&quot;UTF-8&quot;&gt;\n    &amp;lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;\n    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &amp;lt;title&gt;Ajax Crud&amp;lt;\/title&gt;\n    &amp;lt;link href=&quot;https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.0-beta3\/dist\/css\/bootstrap.min.css&quot; rel=&quot;stylesheet&quot; integrity=&quot;sha384-eOJMYsd53ii+scO\/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6&quot; crossorigin=&quot;anonymous&quot;&gt;\n&amp;lt;\/head&gt;\n&amp;lt;body&gt;\n    &amp;lt;section style=&quot;padding-top:60px&quot;&gt;\n        &amp;lt;div class=&quot;container&quot;&gt;\n            &amp;lt;div class=&quot;row&quot;&gt;\n                &amp;lt;div class=&quot;col-md-12&quot;&gt;\n                    &amp;lt;div class=&quot;card&quot;&gt;\n                        &amp;lt;div class=&quot;card-header&quot;&gt;\n                            Students &amp;lt;a href=&quot;#&quot; class=&quot;btn btn-success&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#StudentModal&quot;&gt;Add New Students&amp;lt;\/a&gt;\n                        &amp;lt;\/div&gt;\n                        &amp;lt;div class=&quot;card-body&quot;&gt;\n                            &amp;lt;table id=&quot;studentTable&quot; class=&quot;table&quot;&gt;\n                                &amp;lt;thead&gt;\n                                    &amp;lt;tr&gt;\n                                        &amp;lt;th&gt;First Name&amp;lt;\/th&gt;\n                                        &amp;lt;th&gt;Last Name&amp;lt;\/th&gt;\n                                        &amp;lt;th&gt;Email&amp;lt;\/th&gt;\n                                        &amp;lt;th&gt;Phone&amp;lt;\/th&gt;\n                                    &amp;lt;\/tr&gt;\n                                &amp;lt;\/thead&gt;\n                                &amp;lt;tbody&gt;\n                                    @foreach($students as $student)\n                                        &amp;lt;tr&gt;\n                                            &amp;lt;td&gt;{{$student-&gt;firstname}}&amp;lt;\/td&gt;\n                                            &amp;lt;td&gt;{{$student-&gt;lastname}}&amp;lt;\/td&gt;\n                                            &amp;lt;td&gt;{{$student-&gt;email}}&amp;lt;\/td&gt;\n                                            &amp;lt;td&gt;{{$student-&gt;phone}}&amp;lt;\/td&gt;\n                                        &amp;lt;\/tr&gt;\n                                    @endforeach\n                                &amp;lt;\/tbody&gt;\n                            &amp;lt;\/table&gt;\n                        &amp;lt;\/div&gt;\n                    &amp;lt;\/div&gt;\n                &amp;lt;\/div&gt;\n            &amp;lt;\/div&gt;\n        &amp;lt;\/div&gt;\n    &amp;lt;\/section&gt;\n\n    &amp;lt;!-- modal start --&gt;\n\n    &amp;lt;!-- Button trigger modal --&gt;\n    &amp;lt;!-- Modal --&gt;\n    &amp;lt;div class=&quot;modal fade&quot; id=&quot;StudentModal&quot; tabindex=&quot;-1&quot; aria-labelledby=&quot;exampleModalLabel&quot; aria-hidden=&quot;true&quot;&gt;\n        &amp;lt;div class=&quot;modal-dialog&quot;&gt;\n        &amp;lt;div class=&quot;modal-content&quot;&gt;\n            &amp;lt;div class=&quot;modal-header&quot;&gt;\n            &amp;lt;h5 class=&quot;modal-title&quot; id=&quot;exampleModalLabel&quot;&gt;Add new student&amp;lt;\/h5&gt;\n            &amp;lt;button type=&quot;button&quot; class=&quot;btn-close&quot; data-bs-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;&amp;lt;\/button&gt;\n            &amp;lt;\/div&gt;\n            &amp;lt;div class=&quot;modal-body&quot;&gt;\n            &amp;lt;form action=&quot;&quot; id=&quot;studentForm&quot;&gt;\n                @csrf\n                &amp;lt;div class=&quot;form-group&quot;&gt;\n                    &amp;lt;label for=&quot;FirstName&quot;&gt;First Name&amp;lt;\/label&gt;\n                    &amp;lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;firstname&quot;&gt;\n                &amp;lt;\/div&gt;\n                &amp;lt;div class=&quot;form-group&quot;&gt;\n                    &amp;lt;label for=&quot;LastName&quot;&gt;Last Name&amp;lt;\/label&gt;\n                    &amp;lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;lastname&quot;&gt;\n                &amp;lt;\/div&gt;\n                &amp;lt;div class=&quot;form-group&quot;&gt;\n                    &amp;lt;label for=&quot;email&quot;&gt;Email&amp;lt;\/label&gt;\n                    &amp;lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;email&quot;&gt;\n                &amp;lt;\/div&gt;\n                &amp;lt;div class=&quot;form-group&quot;&gt;\n                    &amp;lt;label for=&quot;phone&quot;&gt;Phone&amp;lt;\/label&gt;\n                    &amp;lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;phone&quot;&gt;\n                &amp;lt;\/div&gt;\n                &amp;lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Submit&amp;lt;\/button&gt;\n            &amp;lt;\/form&gt;\n            &amp;lt;\/div&gt;\n            \n        &amp;lt;\/div&gt;\n        &amp;lt;\/div&gt;\n    &amp;lt;\/div&gt;\n    &amp;lt;script&gt;\n        $(&quot;#studentForm&quot;).submit(function(e){\n            e.preventDefault();\n            let firstname = $(&quot;#firstname&quot;).val();\n            let lastname = $(&quot;#lastname&quot;).val();\n            let email = $(&quot;#email&quot;).val();\n            let phone = $(&quot;#phone&quot;).val();\n            let _token = $(&quot;input&#x5B;name=_token]&quot;).val();\n\n            $.ajax({\n                url: &quot;{{route(&#039;student.add&#039;)}}&quot;,\n                type:&quot;POST&quot; ,\n                data: {\n                    firstname:firstname,\n                    lastname:lastname,\n                    email:email,\n                    phone:phone,\n                    _token:_token\n                },\n                success:function(response)\n                {\n                    if(response){\n                        $(&quot;#studentTable tbody&quot;).prepend(&#039;&amp;lt;tr&gt;&amp;lt;td&gt;&#039;+response.firstname+&#039;&amp;lt;\/td&gt;&amp;lt;td&gt;&#039;+response.lastname+&#039; &amp;lt;\/td&gt;&amp;lt;td&gt;&#039;+response.email+&#039;&amp;lt;\/td&gt;&amp;lt;td&gt;&#039;+response.phone+&#039;&amp;lt;\/td&gt;&amp;lt;\/tr&gt;&#039;);\n                        $(&quot;#studentForm&quot;)&#x5B;0].reset();\n                        $(&quot;#studentModal&quot;).modal(&#039;hide&#039;);\n                    }\n                }\n            });\n\n        });\n    &amp;lt;\/script&gt;\n    &amp;lt;script src=&quot;https:\/\/cdn.jsdelivr.net\/npm\/@popperjs\/core@2.9.1\/dist\/umd\/popper.min.js&quot; integrity=&quot;sha384-SR1sx49pcuLnqZUnnPwx6FCym0wLsk5JZuNx2bPPENzswTNFaQU1RDvt3wT4gWFG&quot; crossorigin=&quot;anonymous&quot;&gt;&amp;lt;\/script&gt;\n    &amp;lt;script src=&quot;https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.0-beta3\/dist\/js\/bootstrap.min.js&quot; integrity=&quot;sha384-j0CNLUeiqtyaRmlzUHCPZ+Gy5fQu0dQ6eZ\/xAww941Ai1SxSY+0EQqNXNE6DZiVc&quot; crossorigin=&quot;anonymous&quot;&gt;&amp;lt;\/script&gt;\n    &amp;lt;script src=&quot;https:\/\/code.jquery.com\/jquery-3.6.0.js&quot; integrity=&quot;sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=&quot; crossorigin=&quot;anonymous&quot;&gt;&amp;lt;\/script&gt;\n&amp;lt;\/body&gt;\n&amp;lt;\/html&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 10 :<\/strong> Create another function in <strong>StudentController.php<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic function addStudent(Request $request)\n\t{\n\t\t$student = new Student();\n\t\t$student-&gt;firstname = $request-&gt;firstname;\n\t\t$student-&gt;lastname = $request-&gt;lastname;\n\t\t$student-&gt;email = $request-&gt;email;\n\t\t$student-&gt;phone = $request-&gt;phone;\n\t\t$student-&gt;save();\n\t\treturn response()-&gt;json($student);\n\t}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcda <strong>Step 11 :<\/strong> Now create a route for <strong>addStudent<\/strong>() function, so for this open <strong>web.php<\/strong> file again<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRoute::post(&#039;\/add-student&#039;, &#x5B;StudentController::class,&#039;addStudent&#039;])-&gt;name(&#039;student.add&#039;);\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">At last fill the data into popup form and you will see that your form is working fine. yay we did it. Let&#8217;s congratulate yourself that you create a CRUD using ajax in Laravel 8.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you find any issue on above steps then feel free to comment. I will feel very happy to resolve your problems in it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey friends, I came again to all of you with a new article, must follow below steps to create a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5049],"tags":[5105,5261],"class_list":["post-6015","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-ajax","tag-laravel8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Laravel 8 - Insert record using ajax - 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-8-insert-record-using-ajax\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Laravel 8 - Insert record using ajax - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Hey friends, I came again to all of you with a new article, must follow below steps to create a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-01T07:42:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-01T12:05:29+00:00\" \/>\n<meta name=\"author\" content=\"Chandan Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chandan Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/\"},\"author\":{\"name\":\"Chandan Kumar\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0990c0a2b3e841b474db853d83993e98\"},\"headline\":\"Laravel 8 &#8211; Insert record using ajax\",\"datePublished\":\"2021-05-01T07:42:37+00:00\",\"dateModified\":\"2021-05-01T12:05:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/\"},\"wordCount\":271,\"keywords\":[\"ajax\",\"laravel8\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/\",\"name\":\"Laravel 8 - Insert record using ajax - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2021-05-01T07:42:37+00:00\",\"dateModified\":\"2021-05-01T12:05:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0990c0a2b3e841b474db853d83993e98\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-8-insert-record-using-ajax\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Laravel 8 &#8211; Insert record using ajax\"}]},{\"@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\\\/0990c0a2b3e841b474db853d83993e98\",\"name\":\"Chandan Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g\",\"caption\":\"Chandan Kumar\"},\"description\":\"Be a Full Stack Developer and eager to learn new Technology. Knowledge: CSS, Bootstrap, Javascript, PHP, WordPress, Joomla, Moodle, Laravel, AJAX, Jquery, Java, Dart, Flutter, Photoshop, CorelDraw, Pagemaker &amp; Office Package\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/chandan\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Laravel 8 - Insert record using ajax - 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-8-insert-record-using-ajax\/","og_locale":"en_US","og_type":"article","og_title":"Laravel 8 - Insert record using ajax - scmGalaxy","og_description":"Hey friends, I came again to all of you with a new article, must follow below steps to create a [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/","og_site_name":"scmGalaxy","article_published_time":"2021-05-01T07:42:37+00:00","article_modified_time":"2021-05-01T12:05:29+00:00","author":"Chandan Kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Chandan Kumar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/"},"author":{"name":"Chandan Kumar","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0990c0a2b3e841b474db853d83993e98"},"headline":"Laravel 8 &#8211; Insert record using ajax","datePublished":"2021-05-01T07:42:37+00:00","dateModified":"2021-05-01T12:05:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/"},"wordCount":271,"keywords":["ajax","laravel8"],"articleSection":["Laravel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/","name":"Laravel 8 - Insert record using ajax - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2021-05-01T07:42:37+00:00","dateModified":"2021-05-01T12:05:29+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0990c0a2b3e841b474db853d83993e98"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-8-insert-record-using-ajax\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Laravel 8 &#8211; Insert record using ajax"}]},{"@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\/0990c0a2b3e841b474db853d83993e98","name":"Chandan Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g","caption":"Chandan Kumar"},"description":"Be a Full Stack Developer and eager to learn new Technology. Knowledge: CSS, Bootstrap, Javascript, PHP, WordPress, Joomla, Moodle, Laravel, AJAX, Jquery, Java, Dart, Flutter, Photoshop, CorelDraw, Pagemaker &amp; Office Package","url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/chandan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6015","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=6015"}],"version-history":[{"count":7,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6015\/revisions"}],"predecessor-version":[{"id":6023,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6015\/revisions\/6023"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=6015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=6015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=6015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}