{"id":8661,"date":"2020-01-11T12:45:52","date_gmt":"2020-01-11T12:45:52","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=8661"},"modified":"2021-11-13T11:58:08","modified_gmt":"2021-11-13T11:58:08","slug":"exploring-directory-structure-of-laravel","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/exploring-directory-structure-of-laravel\/","title":{"rendered":"Exploring Directory Structure in laravel."},"content":{"rendered":"\n<p>Laravel applications follow the&nbsp;<strong>Model-View-Controller<\/strong>&nbsp;architecture design pattern.<\/p>\n\n\n\n<p><strong>Models<\/strong>&nbsp;represent the entities in the database and help you to query the database and return the data<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"316\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-27.png\" alt=\"\" class=\"wp-image-8662\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-27.png 602w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/image-27-300x157.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>Views&nbsp;are the pages that will be displayed when accessed the app. View Component is used for the User Interface of the application.<\/p>\n\n\n\n<p><strong>Controllers<\/strong>&nbsp;handle user requests, gets required data from the models and pass them to the Views. Controllers acts as an intermediary between Model and View Components to process the business logic and incoming request.<\/p>\n\n\n\n<p><strong>App:&nbsp;<\/strong>This directory is the meat of the application and contains the core code.<\/p>\n\n\n\n<p><strong>Console:<\/strong>&nbsp;This directory contains all the custom Artisan commands created using.<\/p>\n\n\n\n<p><strong>Exceptions:<\/strong>&nbsp;This directory contains the application\u2019s exception\nhandler and is a good place to add custom exception classes to handle\ndifferent exceptions thrown by your application.<\/p>\n\n\n\n<p><strong>Http:<\/strong>&nbsp;This directory contains all your controllers,\nmiddleware and requests.<\/p>\n\n\n\n<p><strong>Providers:<\/strong>&nbsp;This directory contains all your service providers for\nthe application. <\/p>\n\n\n\n<p><strong>Bootstrap:<\/strong>&nbsp;This directory contains framework bootstrap as well as\nconfiguration files. It also contains&nbsp;<em><strong>Cache&nbsp;<\/strong><\/em>directory which\ncontains framework generated cache files<\/p>\n\n\n\n<p><strong>Config:<\/strong>&nbsp;This directory contains all your application\u2019s\nconfiguration files.<\/p>\n\n\n\n<p><strong>Database:<\/strong>&nbsp;This directory contains all database migrations and seeds. You can also store the SQLite database file here.<\/p>\n\n\n\n<p><strong>Public:<\/strong>&nbsp;This directory contains assets like images, js files, and CSS.<\/p>\n\n\n\n<p><strong>Resources:<\/strong>&nbsp;This directory contains all view files and LESS or SASS\nfiles. It also contains&nbsp;<em><strong>lang<\/strong><\/em>&nbsp;directory to\nstore language files.<\/p>\n\n\n\n<p><strong>Routes:<\/strong>&nbsp;This directory contains all routes definitions for the application.&nbsp;<em><strong>php<\/strong><\/em>&nbsp;is the file that receives all the requests to yours. application and here you can redirect (welcome.blade.php)the requests to their respective controller methods. <\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/03-1.png\" alt=\"\" class=\"wp-image-8666\" width=\"613\" height=\"321\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/03-1.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/03-1-300x158.png 300w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/figure>\n\n\n\n<p><strong>Storage:<\/strong>&nbsp;This directory contains blade templates, session files, cache files and others.<\/p>\n\n\n\n<p><strong>Tests:<\/strong>&nbsp;This directory contains all the test files.<\/p>\n\n\n\n<p><strong>Vendor:<\/strong>\u00a0This directory contains all the composer dependencies.<\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_29291\"><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_56981\"  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_29291\"  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 applications follow the&nbsp;Model-View-Controller&nbsp;architecture design pattern. Models&nbsp;represent the entities in the database and help you to query the database and return the data Views&nbsp;are the pages that will be displayed when accessed the app. View Component is used for the User Interface of the application. Controllers&nbsp;handle user requests, gets required data from the models and&#8230;<\/p>\n","protected":false},"author":15,"featured_media":8667,"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,5150],"tags":[5652,3021,5651,5355,3940,1692,5137,634,5653,1863,5654,5655,5650],"class_list":["post-8661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-php","tag-config","tag-console","tag-controller","tag-database","tag-http","tag-model","tag-public","tag-resources","tag-route","tag-storage","tag-tests","tag-vendor","tag-view"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8661","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=8661"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8661\/revisions"}],"predecessor-version":[{"id":25149,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8661\/revisions\/25149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/8667"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=8661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=8661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=8661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}