Last active
January 29, 2021 20:48
-
-
Save xyzkpz/481a14c16bab53bd3f2dd36c41a40b78 to your computer and use it in GitHub Desktop.
install laravel using composer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first install composer exe from this website - https://getcomposer.org/download/ | |
reboot pc | |
run 4 command in htdoc create project folder pro | |
>>>> C:\MAMP\htdocs\pro\cmd.exe | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
php composer-setup.php | |
php -r "unlink('composer-setup.php');" | |
-------------- INSTALL SPECIFIC VERSION OF LARAVEL | |
$ php composer.phar create-project laravel/laravel="5.5.*" mynews | |
>>> now create project folder for laravel installation | |
php composer.phar create-project laravel/laravel pro | |
goto open ini file and remove the ";" from file and save it than it will work and install laravel for first time | |
>> php --ini | |
https://stackoverflow.com/questions/52734707/your-requirements-could-not-be-resolved-to-an-installable-set-of-packages-for-la | |
--------------------- | |
now copy .htaccess file from public folder and paste it into pro folder and | |
C:\MAMP\htdocs\pro\pro\public to C:\MAMP\htdocs\pro\pro | |
copy server.php and paste it into same folder and rename it to index.php | |
C:\MAMP\htdocs\pro\pro to C:\MAMP\htdocs\pro\pro | |
it will install laravel peoperly upen below url in browser and confirm | |
http://localhost/pro/pro/ | |
------------------- CREATE AND INSTALL SPECIFIC VERSION OF LARAVEL --------- READ BELOW BLOG TO CHECK VERSION -------- | |
https://tecadmin.net/check-laravel-version/#:~:text=Check%20Laravel%20Version%20in%20File&text=WHM%2FcPanel%20users%20can%20use,directory%20and%20open%20below%20file.&text=Then%20search%20for%20the%20string,version%20of%20the%20Laravel%20application. | |
----- CHECK BELOW PATH TO CHECK LARAVEL VERSION | |
vim ./vendor/laravel/framework/src/Illuminate/Foundation/Application.php | |
------------------ CREATE PROJECT FOLDER IN LARAVEL | |
$ php composer.phar create-project laravel/laravel pro | |
Creating a "laravel/laravel" project at "./pro" | |
Installing laravel/laravel (v8.5.5) | |
- Installing laravel/laravel (v8.5.5): Extracting archive | |
Created project in C:\MAMP\htdocs\pro\pro | |
. | |
. | |
. | |
------------------- CREATE CONTROLLER IN LARAVEL ---------------- THERE WAS 2 WAYS---------------------- | |
$ php artisan make:controller Add | |
Controller created successfully. | |
----------------- TO CREATE RESOURCE FULL CONTROLLER IT IS GOOD AND EVERYTHING IS WORKING IN 8X LARAVEL VERSION | |
--------------- JUST GIVE UNIQUE NAME WITH CAPITAL LETTER | |
$ php artisan make:controller Abcde --resource | |
Controller created successfully. | |
----------- creating controller for admin area | |
$ php artisan make:controller admin/Dashboard --resource | |
---------------- CREATE MODEL AND MIGRATE SAME TIME ------------- | |
BY DEFAULT USER model come with laravel and 2 defalult migations for register user and forgot paassword | |
create model and migrate give any name and creates migrations files and than we do migrate to refelect to the table creation | |
$ php artisan make:model Students -m | |
it will create tables in the database once its done go to db and check db tables | |
$ php artisan migrate | |
----------- TO MIGRATE DB CHANGES INITIALLY IT CREATE 2 TABLES---------- | |
$ php artisan migrate | |
Migration table created successfully. | |
Migrating: 2014_10_12_000000_create_users_table | |
Migrated: 2014_10_12_000000_create_users_table | |
Migrating: 2014_10_12_100000_create_password_resets_table | |
Migrated: 2014_10_12_100000_create_password_resets_table | |
------------ TO USE DEFAULT PHP AUTHEENTICATIONS ------------------------------- | |
$ php artisan make:auth | |
Authentication scaffolding generated successfully. | |
----create user in db first than than after follow below steps to add css and route to web file and | |
http://localhost/pro/mynews/login | |
it will create auth folder in views section we have to fix and target css and js to proper destinations | |
so {{ asset('public/css/app.css') }} | {{ asset('public/js/app.js') }} | |
than try to login it works ...... | |
------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment