{"flag":true,"single":true,"pageTitle":"how to install laravel composer in windows 10","post":{"id":1,"user_id":"1","slug":"intro-and-app-structure-ywst","title":"how to install laravel composer in windows 10","body":"<p>1. Install composer&nbsp;<a href=\"https:\/\/getcomposer.org\/\" target=\"_blank\" rel=\"noopener\">Composer (getcomposer.org)<\/a><\/p>\r\n<p>2.&nbsp; Install laravel in htdocs<\/p>\r\n<pre class=\"language-markup\"><code>composer create-project laravel\/laravel example-app<\/code><\/pre>\r\n<p>3. open cmd in larvel app&nbsp; (example-app) directory and type command&nbsp;<\/p>\r\n<pre class=\"language-markup\"><code>php artisan serve<\/code><\/pre>\r\n<p><strong>Request Life cycle:<\/strong><\/p>\r\n<ol>\r\n<li>All requests goto public\/index.php by webserver its load composer autoload, create $app instance from <strong>bootstrap\/app.php<\/strong><\/li>\r\n<li>Next, the incoming request is sent to either the HTTP kernel <strong>(app\/Http\/Kernel.php)<\/strong> or the console kernel. It configure error handling, configure logging, detect the application environment, defines a list of HTTP middleware (eading and writing the HTTP session, maintenance mode, verifying the CSRF token)<\/li>\r\n<li>handle method is quite simple: it receives a Request and returns a Response.&nbsp;<\/li>\r\n<li>One of the most important kernel bootstrapping actions is loading the service providers. Service providers are responsible for bootstrapping all of the framework's various components, such as the database, queue, validation, and routing components<\/li>\r\n<li>Routing<\/li>\r\n<li>Response travels&gt;middleware, &gt;kernel's handle method returns the response object&gt;index.php calls <strong>send method<\/strong> on the returned response.<\/li>\r\n<li>The <strong>send method<\/strong> sends the response content to the user's web browser.<\/li>\r\n<\/ol>\r\n<p><strong>Configrations:<\/strong><\/p>\r\n<p>All configrations are insdie config folder.<\/p>\r\n<pre class=\"language-markup\"><code>php artisan about<\/code><\/pre>\r\n<p>Encrypt env for security purpose and save the key<\/p>\r\n<pre class=\"language-markup\"><code>php artisan env:encrypt<\/code><\/pre>\r\n<p>To decrypt<\/p>\r\n<pre class=\"language-markup\"><code>php artisan env:decrypt --key=3UVsEgGVK36XN82KKeyLFMhvosbZN1aF<\/code><\/pre>\r\n<p><strong>APP structure<\/strong><\/p>\r\n<p>&gt;<strong>http<\/strong> folder contains models,controllers and middlewares<\/p>\r\n<p>&gt; <strong>database<\/strong> contain migration (auto create tables), seeders (add data auto into tables),<\/p>\r\n<p>&gt; <strong>public<\/strong> folder contains assets<\/p>\r\n<p>&gt; <strong>resources<\/strong> contains views and front end files<\/p>\r\n<p>&gt; <strong>routes<\/strong> contain url structure<\/p>\r\n<p>&gt; <strong>storage<\/strong> contain uploaded files<\/p>\r\n<p>&gt;<strong>vendor<\/strong> contain libraries<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>LIFE CYCLE<\/strong><\/p>\r\n<div>It loads rest of framework ie composer generated autoloaders<\/div>\r\n<div>&gt;public\/index.php&nbsp;<\/div>\r\n<div>then retrieves an instance of the Laravel application from bootstrap\/app.php inside index.php&nbsp;<\/div>\r\n<div>$app = require_once __DIR__.'\/..\/bootstrap\/app.php';<\/div>\r\n<div>&nbsp;<\/div>\r\n<div>NEXT &gt;Kernal run before request is executed, Request is sent to http kernal or console kernal using the handleRequest or handleCommand<\/div>\r\n<div>kernal also handle sessions, maintence mode, verify csrf token, etc using middlewares<\/div>\r\n<div>handle method receives a Request and returns a Response<\/div>\r\n<div>$kernel = $app-&gt;make(Kernel::class);<\/div>\r\n<div>&nbsp;<\/div>\r\n<div>&nbsp;<\/div>\r\n<div>NEXT&gt; Service providers are loaded, ie database, validation , queue, etc. Laravel iterate through this list of providers and instantiate each of them.Then &gt; register() method will be called on all of the providers to register. then boot() method will be called on each provider.&nbsp;<\/div>\r\n<div>&nbsp;<\/div>\r\n<div>&nbsp;<\/div>\r\n<div>Next&gt; Once the application has been bootstrapped and all service providers have been registered, the Request will be handed off to the router for dispatching.&nbsp;<\/div>\r\n<div>&nbsp;<\/div>\r\n<div>Once the route or controller method returns a response, the response&gt; route's middleware&gt; HTTP kernel's handle() method returns the response object to the handleRequest of the application instance, and this method calls the send() method on the returned response. The send method sends the response content to the user's web browser.<\/div>\r\n<div>==========================<\/div>\r\n<div>I would like to request the implementation of Two-Factor Authentication (2FA) on the Admin Panel only. Only admins will need to enter the verification code. There is no need to enable 2FA for regular users.<\/div>","category_id":"2","is_private":"0","created_at":"2023-03-14T04:06:30.000000Z","updated_at":"2025-02-21T04:57:54.000000Z","category":{"id":2,"user_id":"1","name":"Laravel Core","slug":"laravel-nhyt","parent_id":"1","created_at":"2023-03-14T03:58:27.000000Z","updated_at":"2023-03-20T11:30:50.000000Z"},"user":{"id":1,"name":"R GONDAL","email":"rizikmw@gmail.com","email_verified_at":null,"two_factor_confirmed_at":null,"current_team_id":"1","profile_photo_path":null,"created_at":"2023-03-12T10:49:33.000000Z","updated_at":"2025-01-10T12:59:00.000000Z","profile_photo_url":"https:\/\/ui-avatars.com\/api\/?name=R+G&color=7F9CF5&background=EBF4FF"}},"pageDesc":"1. Install composer&nbsp;Composer (getcomposer.org) 2.&nbsp; Install laravel in htdocs composer create-project laravel\/laravel example-app 3 - how to install laravel composer in windows 10 (Updated: February 21, 2025) - Read more about how to install laravel composer in windows 10 at my programming site [SITE]","categories":[]}