{"id":446,"date":"2023-06-20T22:32:36","date_gmt":"2023-06-20T22:32:36","guid":{"rendered":"https:\/\/www.devopsfreelancer.com\/blog\/?p=446"},"modified":"2023-06-20T22:33:48","modified_gmt":"2023-06-20T22:33:48","slug":"how-to-insert-category-function-in-laravel","status":"publish","type":"post","link":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/","title":{"rendered":"How to Insert Category function in Laravel ?"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"533\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png\" alt=\"\" class=\"wp-image-448\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-300x156.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-768x400.png 768w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In this tutorial I&#8217;m going to insert category system in laravel in very easy way follow this video we &#8216;have demonstrated in very easy way.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Php artisan make:model BlogCategory -m<\/code><\/pre>\n\n\n\n<p><strong>Next go to migration file and paste below code.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nnamespace App\\Models;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\nclass BlogCategory extends Model\n{\n    use HasFactory;\n    protected $guarded = &#91;];\n}\n<\/code><\/pre>\n\n\n\n<p><strong>Next go to migration file and paste below code.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\nreturn new class extends Migration\n{\n    \/**\n     * Run the migrations.\n     *\/\n    public function up(): void\n    {\n        Schema::create('blog_categories', function (Blueprint $table) {\n            $table-&gt;id();\n            $table-&gt;string('blog_category')-&gt;nullable();\n            $table-&gt;timestamps();\n        });\n    }\n    \/**\n     * Reverse the migrations.\n     *\/\n    public function down(): void\n    {\n        Schema::dropIfExists('blog_categories');\n    }\n};\n<\/code><\/pre>\n\n\n\n<p>Next create controller and paste below code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan make:controller Home\/BlogCategoryController\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nnamespace App\\Http\\Controllers\\Home;\nuse App\\Http\\Controllers\\Controller;\nuse App\\Models\\BlogCategory;\nuse Illuminate\\Http\\Request;\nclass BlogCategoryController extends Controller\n{\n    public function AllBlogCategory(){\n        $blogcategory = BlogCategory::latest()-&gt;get();\n        return view('admin.blog_category.blog_category_all',compact('blogcategory'));\n    }\n    public function AddBlogCategory()\n    {\n        return view('admin.blog_category.blog_category_add');\n    }\n    public function StoreBlogCategory(Request $request)\n    {\n        $request-&gt;validate(&#91;\n            'blog_category' =&gt; 'required',\n        ], &#91;\n            'blog_category.required' =&gt; 'Blog Cateogry Name is Required',\n        ]);\n        BlogCategory::insert(&#91;\n            'blog_category' =&gt; $request-&gt;blog_category,\n        ]);\n        $notification = array(\n            'message' =&gt; 'Blog Category Inserted Successfully',\n            'alert-type' =&gt; 'success',\n        );\n        return redirect()-&gt;route('all.blog.category')-&gt;with($notification);\n    }\n    public function EditBlogCategory($id)\n    {\n        $blogcategory = BlogCategory::findOrFail($id);\n        return view('admin.blog_category.blog_category_edit', compact('blogcategory'));\n    }\n    public function UpdateBlogCategory(Request $request, $id)\n    {\n        BlogCategory::findOrFail($id)-&gt;update(&#91;\n            'blog_category' =&gt; $request-&gt;blog_category,\n        ]);\n        $notification = array(\n            'message' =&gt; 'Blog Category Updated Successfully',\n            'alert-type' =&gt; 'success',\n        );\n        return redirect()-&gt;route('all.blog.category')-&gt;with($notification);\n    } \/\/ End Method\n    public function DeleteBlogCategory($id)\n    {\n        BlogCategory::findOrFail($id)-&gt;delete();\n        $notification = array(\n            'message' =&gt; 'Blog Category Deleted Successfully',\n            'alert-type' =&gt; 'success',\n        );\n        return redirect()-&gt;back()-&gt;with($notification);\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>Next go to view page and paste below code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@extends('admin.admin_master')\n@section('admin')\n    &lt;div class=\"page-content\"&gt;\n        &lt;div class=\"container-fluid\"&gt;\n            &lt;!-- start page title --&gt;\n            &lt;div class=\"row\"&gt;\n                &lt;div class=\"col-12\"&gt;\n                    &lt;div class=\"page-title-box d-sm-flex align-items-center justify-content-between\"&gt;\n                        &lt;h4 class=\"mb-sm-0\"&gt;Blog Category All&lt;\/h4&gt;\n                    &lt;\/div&gt;\n                &lt;\/div&gt;\n            &lt;\/div&gt;\n            &lt;!-- end page title --&gt;\n            &lt;div class=\"row\"&gt;\n                &lt;div class=\"col-12\"&gt;\n                    &lt;div class=\"card\"&gt;\n                        &lt;div class=\"card-body\"&gt;\n                            &lt;h4 class=\"card-title\"&gt;Blog Category All Data &lt;\/h4&gt;\n                            &lt;table id=\"datatable\" class=\"table table-bordered dt-responsive nowrap\"\n                                style=\"border-collapse: collapse; border-spacing: 0; width: 100%;\"&gt;\n                                &lt;thead&gt;\n                                    &lt;tr&gt;\n                                        &lt;th&gt;Sl&lt;\/th&gt;\n                                        &lt;th&gt;Blog Category Name&lt;\/th&gt;\n                                        &lt;th&gt;Action&lt;\/th&gt;\n                                &lt;\/thead&gt;\n                                &lt;tbody&gt;\n                                    @foreach ($blogcategory as $key =&gt; $item)\n                                        &lt;tr&gt;\n                                            &lt;td&gt; {{ $key + 1 }} &lt;\/td&gt;\n                                            &lt;td&gt; {{ $item-&gt;blog_category }} &lt;\/td&gt;\n                                            &lt;td&gt;\n                                                &lt;a href=\"{{ route('edit.blog.category', $item-&gt;id) }}\"\n                                                    class=\"btn btn-info sm\" title=\"Edit Data\"&gt; &lt;i class=\"fas fa-edit\"&gt;&lt;\/i&gt;\n                                                &lt;\/a&gt;\n                                                &lt;a href=\"{{ route('delete.blog.category', $item-&gt;id) }}\"\n                                                    class=\"btn btn-danger sm\" title=\"Delete Data\" id=\"delete\"&gt; &lt;i\n                                                        class=\"fas fa-trash-alt\"&gt;&lt;\/i&gt; &lt;\/a&gt;\n                                            &lt;\/td&gt;\n                                        &lt;\/tr&gt;\n                                    @endforeach\n                                &lt;\/tbody&gt;\n                            &lt;\/table&gt;\n                        &lt;\/div&gt;\n                    &lt;\/div&gt;\n                &lt;\/div&gt; &lt;!-- end col --&gt;\n            &lt;\/div&gt; &lt;!-- end row --&gt;\n        &lt;\/div&gt; &lt;!-- container-fluid --&gt;\n    &lt;\/div&gt;\n@endsection<\/code><\/pre>\n\n\n\n<p>Next go to route and paste below code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Route::controller(BlogCategoryController::class)-&gt;group(function () {\n    Route::get('\/all\/blog\/category', 'AllBlogCategory')-&gt;name('all.blog.category');\n    Route::get('\/add\/blog\/category', 'AddBlogCategory')-&gt;name('add.blog.category');\n    Route::post('\/store\/blog\/category', 'StoreBlogCategory')-&gt;name('store.blog.category');\n    Route::get('\/edit\/blog\/category\/{id}', 'EditBlogCategory')-&gt;name('edit.blog.category');\n    Route::post('\/update\/blog\/category\/{id}', 'UpdateBlogCategory')-&gt;name('update.blog.category');\n    Route::get('\/delete\/blog\/category\/{id}', 'DeleteBlogCategory')-&gt;name('delete.blog.category');\n});\n<\/code><\/pre>\n\n\n\n<p>Next add code in your sidebar<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;ul class=\"sub-menu\" aria-expanded=\"false\"&gt;\n      &lt;li&gt;&lt;a href=\"{{ route('all.blog.category')}}\"&gt;All Blog Category&lt;\/a&gt;&lt;\/li&gt;\n      &lt;li&gt;&lt;a href=\"{{ route('add.blog.category') }}\"&gt;Add Blog Category&lt;\/a&gt;&lt;\/li&gt;\n&lt;\/ul&gt;\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"864\" height=\"210\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-3.png\" alt=\"\" class=\"wp-image-447\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-3.png 864w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-3-300x73.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-3-768x187.png 768w\" sizes=\"auto, (max-width: 864px) 100vw, 864px\" \/><\/figure>\n\n\n\n<p>Now all setup is done<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"533\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png\" alt=\"\" class=\"wp-image-448\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-300x156.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-768x400.png 768w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"520\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-5-1024x520.png\" alt=\"\" class=\"wp-image-449\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-5-1024x520.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-5-300x152.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-5-768x390.png 768w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-5.png 1363w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial I&#8217;m going to insert category system in laravel in very easy way follow this video we &#8216;have demonstrated in very easy way. Next go&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[148,149,3,150],"class_list":["post-446","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-crud","tag-larave-add-category","tag-laravel","tag-php-with-crud"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Insert Category function in Laravel ? - DevOps Freelancer<\/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.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Insert Category function in Laravel ? - DevOps Freelancer\" \/>\n<meta property=\"og:description\" content=\"In this tutorial I&#8217;m going to insert category system in laravel in very easy way follow this video we &#8216;have demonstrated in very easy way. Next go...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Freelancer\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/amitsthakurs\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-20T22:32:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-20T22:33:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png\" \/>\n<meta name=\"author\" content=\"Amit Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/amits_thakurs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amit Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/\"},\"author\":{\"name\":\"Amit Kumar\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\"},\"headline\":\"How to Insert Category function in Laravel ?\",\"datePublished\":\"2023-06-20T22:32:36+00:00\",\"dateModified\":\"2023-06-20T22:33:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/\"},\"wordCount\":86,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-4-1024x533.png\",\"keywords\":[\"crud\",\"larave-add-category\",\"laravel\",\"php-with-crud\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/\",\"name\":\"How to Insert Category function in Laravel ? - DevOps Freelancer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-4-1024x533.png\",\"datePublished\":\"2023-06-20T22:32:36+00:00\",\"dateModified\":\"2023-06-20T22:33:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-4.png\",\"contentUrl\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/image-4.png\",\"width\":1366,\"height\":711},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/how-to-insert-category-function-in-laravel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Insert Category function in Laravel ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/\",\"name\":\"DevOps Freelancer\",\"description\":\"We provide DevOps | SRE | DevSecOps | MLOps Freelancing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\",\"name\":\"Amit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"caption\":\"Amit Kumar\"},\"description\":\"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\\\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/amitsthakurs\\\/\",\"https:\\\/\\\/www.instagram.com\\\/amits_thakurs\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/amits-thakurs\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/amits_thakurs\"],\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/author\\\/amit\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Insert Category function in Laravel ? - DevOps Freelancer","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.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/","og_locale":"en_US","og_type":"article","og_title":"How to Insert Category function in Laravel ? - DevOps Freelancer","og_description":"In this tutorial I&#8217;m going to insert category system in laravel in very easy way follow this video we &#8216;have demonstrated in very easy way. Next go...","og_url":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/","og_site_name":"DevOps Freelancer","article_author":"https:\/\/www.facebook.com\/amitsthakurs\/","article_published_time":"2023-06-20T22:32:36+00:00","article_modified_time":"2023-06-20T22:33:48+00:00","og_image":[{"url":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png","type":"","width":"","height":""}],"author":"Amit Kumar","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/amits_thakurs","twitter_misc":{"Written by":"Amit Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#article","isPartOf":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/"},"author":{"name":"Amit Kumar","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b"},"headline":"How to Insert Category function in Laravel ?","datePublished":"2023-06-20T22:32:36+00:00","dateModified":"2023-06-20T22:33:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/"},"wordCount":86,"commentCount":1,"image":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png","keywords":["crud","larave-add-category","laravel","php-with-crud"],"articleSection":["Laravel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/","url":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/","name":"How to Insert Category function in Laravel ? - DevOps Freelancer","isPartOf":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#primaryimage"},"image":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4-1024x533.png","datePublished":"2023-06-20T22:32:36+00:00","dateModified":"2023-06-20T22:33:48+00:00","author":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b"},"breadcrumb":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#primaryimage","url":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4.png","contentUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/06\/image-4.png","width":1366,"height":711},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopsfreelancer.com\/blog\/how-to-insert-category-function-in-laravel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopsfreelancer.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Insert Category function in Laravel ?"}]},{"@type":"WebSite","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website","url":"https:\/\/www.devopsfreelancer.com\/blog\/","name":"DevOps Freelancer","description":"We provide DevOps | SRE | DevSecOps | MLOps Freelancing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopsfreelancer.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b","name":"Amit Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","caption":"Amit Kumar"},"description":"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.","sameAs":["https:\/\/www.facebook.com\/amitsthakurs\/","https:\/\/www.instagram.com\/amits_thakurs\/","https:\/\/www.linkedin.com\/in\/amits-thakurs\/","https:\/\/x.com\/https:\/\/twitter.com\/amits_thakurs"],"url":"https:\/\/www.devopsfreelancer.com\/blog\/author\/amit\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/comments?post=446"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/446\/revisions"}],"predecessor-version":[{"id":451,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/446\/revisions\/451"}],"wp:attachment":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/media?parent=446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/categories?post=446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/tags?post=446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}