I can not install Laravel. I am using xampp. here's what I get when I try and install it
If you want to create a Laravel application under the name Blog:
rm blog -r
laravel new blog
If you want to create a Laravel application under different name:
laravel new applicationname
(I assume you're very new to Laravel, so welcome! You can delete this question if you want to so it won't hurt your reputation, I'm already give it one thumbs up so it won't hurt that much :) )
The message says that the Laravel project is already created. If you want to create a new Laravel project you have to delete it first, or create it with a different name.
Laravel is designed to be installed into a fresh project directory. However, if for some reason you want to install Laravel into an existing non-empty directory, do the following.
In this example, we install Laravel into foo and then copy it into an existing project named bar
1) Create the new Laravel project:
$ laravel new foo
You should now see your two projects:
$ ls
foo/ bar/
2) Copy Laravel project files into bar/ and rerun Composer installation.
rsync -av --ignore-existing --exclude=vendor foo/ bar
cd bar/
composer install
Beware that this will not overwrite any files in case of name conflicts. If you have an existing composer.json, you will need to manually composer require all the Laravel dependencies. Similarly, if you have an existing .gitignore file, then you should manually merge the two.
Related
I try to create a laravel project named crm and got this error.
[InvalidArgumentException]
Project directory crm/ is not empty
I am using windows system. I have tried to name it in capital letters but got the same error
Yes its because the path which you are trying to create the laravel application
already has the same folder that is not empty
So If You need to create a laravel app by overwriting it
Try
laravel new crm --force
So --force will Forces install even if the directory already exists
Some guy made a site with laravel 5.6 and we at a different place need to change just some tags and the CSS, I have a git of the site but "vendor, .env" and many files that are also missing in the git, how can I open the site in my computer to adjust the style sheets I have no database backup and also installed laravel 5.6 and try to paste de missing files but there are still many errors.
Altough the original programmers excluded some files in the git repo using the ignoregit file I created a new laravel 5.6 project and copied the missing files to my original app folder, imported the missing packages using composer and finally used artisan to migrate the database using "php artisan migrate"
I am working on the Laravel project, and intend to use Vue.js as its client-side scripting. When I searched the internet, I found that I had to use the npm install command. My question is if I run the order, will it affect the project I'm working on?
For example, in the directory structure or variable section?
It will change only package.json and /node_modules folder (it will download vue.js last version package into this folder) in your root directory. But it won't affect your existing codebase until you don't use them via importing or accessing it. It is like installing a package with composer, but not using it. The downloaded package will stay in /vendor folder and package name in composer.json, composer.lock
I have a laravel app in which I want to see the added/changed files
How can I compare my Laravel project to a clean Laravel installation? Is there some software that can achieve this or should I write a script?
I doubt theres something like that specifically for Laravel. However, what you can do is to use Version Control (git) to help if your plan is to compare these 2 projects (Fresh install vs Project)
https://git-scm.com/
I'd do the following steps:
Create a git repo
Place a fresh laravel install on the repo
git add . and create a commit
Replace the whole directory with the new project
View with git diff (SourceTree would help you)
Git diff would give you what files are changed (in regards to the fresh install) and what differs in code. Beware that since we're talking about a Laravel project with a lot of content and a fresh install, it will give a lot of files changed.
My workflow for developing Symfony bundles is the following:
install Symfony
create a git repo for the new bundle, put a composer.json file in there
require the new package in the top-level composer.json, using #dev version
composer update newpackage => the package is downloaded, using git clone
work on the git clone inside vendors, committing and pushing from it
This is all fine and dandy, but seems to break in one specific case:
if I alter the 'autoload' tag of the already-installed package, it seems that Composer has a hard time taking it into account:
I tried 'composer dumpautoload', and it does nothing
I do not want to remove the composer.lock file, as I do not want other packages to be updated to a newer version, I only want to alter the autoload config of that one package
I tried removing by hand vendor/composer/installed.json, and what happened is that Composer re-downloaded all the vendors and wiped any data which happened to be in there at that moment
The same problem manifested itself when I did alter the autoload section of the package on a separate clone, pushed the changes to git and ran 'composer update mypackage' - although that might have been related to packagist not having received the ping from github.
I can of course alter by hand the composer.lock and vendor/composer/installed.json files, but that seems too hackish. It also does not gives the guarantee that user downloading the package the 1st time will see it working.
Try:
./composer.phar dumpautoload -o
It reads the composer.json files and rewrites all the autoload files which pick up the new paths.
dumpautoload uses the package information from vendor/composer/installed.json and not the individual composer.json files. You need to change the autoload info there, too.
The file installed.json is only being update when you run a
composer update