{"id":9050,"date":"2020-01-20T11:43:40","date_gmt":"2020-01-20T11:43:40","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9050"},"modified":"2021-11-13T06:58:30","modified_gmt":"2021-11-13T06:58:30","slug":"introduction-of-some-keyword-using-laravel","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/introduction-of-some-keyword-using-laravel\/","title":{"rendered":"Introduction of Some keyword using  laravel"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/Laravel-Commands.jpg\" alt=\"\" class=\"wp-image-9051\" width=\"582\" height=\"323\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/Laravel-Commands.jpg 900w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/Laravel-Commands-300x167.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/Laravel-Commands-768x427.jpg 768w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/figure>\n\n\n\n<p>Laravel framework provides three primary tools for interaction through command-line namely:&nbsp;<strong>Artisan, <\/strong>explains about Artisan in detail.<\/p>\n\n\n\n<p><strong>Introduction to Artisan<\/strong><\/p>\n\n\n\n<p>&nbsp;Artisan is the command-line interface frequently used in Laravel and it includes a set of helpful commands for developing a web application.<\/p>\n\n\n\n<p> Here is a list of few commands in Artisan along with their respective functionalities  <\/p>\n\n\n\n<p><strong>To start Laravel project<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/8261c1b3e85d005871210b0b8c675d35.js\"><\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"128\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-31.png\" alt=\"\" class=\"wp-image-9052\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-31.png 577w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-31-300x67.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/figure>\n\n\n\n<p><strong>To enable caching mechanism<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/fd10fe2d816fa810a0287bf981bb7da1.js\"><\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"134\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-32.png\" alt=\"\" class=\"wp-image-9053\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-32.png 583w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-32-300x69.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/figure>\n\n\n\n<p><strong>To view the list of available commands supported by Artisan.<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/a53c2490dc068512fb14783d1cfbe5eb.js\"><\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"596\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-33.png\" alt=\"\" class=\"wp-image-9054\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-33.png 602w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-33-300x297.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-33-150x150.png 150w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-33-80x80.png 80w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>make:controller<\/strong><\/h4>\n\n\n\n<p>This command creates a new controller file in&nbsp;<strong>app\/Http\/Controllers<\/strong>&nbsp;folder.<\/p>\n\n\n\n<p><strong>Example:-<\/strong> <\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/89ee6fe0621ef69b5683db5873605e86.js\"><\/script>\n\n\n\n<p>Yes, you\u2019ve got it right, you can do it like this:<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/eca8489614a0ab2732d07af44bd61208.js\"><\/script>\n\n\n\n<p><strong>Or even shorter:<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/9b392e0b863b546138572af768ff9a72.js\"><\/script>\n\n\n\n<p>The controller will contain a method for each of the available resource operations \u2013 index(), create(), store(), show(), edit(), update(), destroy().<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"566\" height=\"295\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-34.png\" alt=\"\" class=\"wp-image-9055\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-34.png 566w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-34-300x156.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>make:model<\/strong><\/h4>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/d8c4541916ffcdcb2dbee23ad3975272.js\"><\/script>\n\n\n\n<p><strong>Parameters: <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">-m<\/pre>\n\n\n\n<p>Or\n\n&#8211;migration\n\n\n\n<\/p>\n\n\n\n<p> Create a new migration file for the model. <\/p>\n\n\n\n<p><strong>make:migration<\/strong>               <\/p>\n\n\n\n<p> Simply put,&nbsp;<strong>Laravel migration<\/strong>&nbsp;is a way that allows you to&nbsp;<strong>create<\/strong>&nbsp;a table in your database, without actually going to the database manager such as phpmyadmin.<\/p>\n\n\n\n<p><strong>Example<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/samcotocus\/79a2bd46c26d05f078122a9de2716f0e.js\"><\/script>\n\n\n\n<p>make:seeder    <\/p>\n\n\n\n<p> Writing&nbsp;<em>Seeders<\/em>&nbsp;To generate a&nbsp;<em>seeder<\/em>, execute the&nbsp;<em>make<\/em>: <em>seeder<\/em>&nbsp;Artisan command. All&nbsp;<em>seeders<\/em>&nbsp;generated by the framework will be placed in the database\/seeds directory: php artisan&nbsp;<em>makes<\/em>:<em>seeder<\/em>&nbsp;UsersTableSeeder. A&nbsp;<em>seeder<\/em>&nbsp;class only contains one method by default: run&nbsp; <\/p>\n\n\n\n<p>php artisan make:seeder BooksTableSeeder<\/p>\n\n\n\n<p>Create a new form request class in&nbsp;<strong>app\/Http\/Requests<\/strong>&nbsp;folder.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"97\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-35.png\" alt=\"\" class=\"wp-image-9059\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-35.png 602w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-35-300x48.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>cache clear syntax: php artisan cache:clear<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"574\" height=\"113\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-36.png\" alt=\"\" class=\"wp-image-9060\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-36.png 574w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-36-300x59.png 300w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/figure>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_59600\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_74988\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_59600\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Laravel framework provides three primary tools for interaction through command-line namely:&nbsp;Artisan, explains about Artisan in detail. Introduction to Artisan &nbsp;Artisan is the command-line interface frequently used in Laravel and it includes a set of helpful commands for developing a web application. Here is a list of few commands in Artisan along with their respective functionalities&#8230;<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[5201],"tags":[333,5295,5607],"class_list":["post-9050","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-command","tag-keyword","tag-syntax"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=9050"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9050\/revisions"}],"predecessor-version":[{"id":25035,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9050\/revisions\/25035"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}