After setting up Homestead for 1 specific project only, I want to run the Artisan CLI for database migrations. I tried to follow this tutorial and I keep getting this error:
Could not open input file: artisan
I set up the project by running these commands (Windows):
composer require laravel/homestead --dev
vendor\\bin\\homestead make
vagrant up
And then I made sure to be in the root project directory and then run php artisan list, which gives the error above.
I also tried to ssh into the Homestead VM and navigated to the code folder (where my project resides) and run php artisan list, to which it gives the same error.
Attached is my working directory where I run the artisan command, as requested:
I have tried running it in root dir and in vendor\\laravel to no avail.
So how would one run the artisan CLI in a Laravel Homestead project?
I think I've figured it out. The problem was that I haven't set up a Laravel project using composer yet, and skipped to install Laravel Homestead for this project.
So to make a Laravel project named e.g. quickstart, one should first create the project by running
composer create-project laravel/laravel quickstart --prefer-dist
(see https://laravel.com/docs/5.1/quickstart#installation for more details)
Only after that, set up homestead for the project by running
composer require laravel/homestead --dev
vendor\bin\homestead make
And now the project should be fully initialized.
Refs: https://laravel.com/docs/5.7/homestead#per-project-installation
Related
I've seen answers for this question, but I'm still really confused, because answers say I need to be in my Laravel's project folder, which I thought I had created.
I'm trying to run the command php
php artisan horizon:install
This is the second step in the Laravel installation guide found here: https://laravel.com/docs/7.x/horizon#installation
My directory structure looks like this in my documents folder in Mac OS:
I've tried running the command in the RetimeWeb, vendor, bin, laravel and horizon folders. What am I doing wrong here? Where is an artisan folder supposed to be?
Laravel Horizon is dashboard for managing queues (jobs) in Laravel that supposed to be installed on top of Laravel project.
Based on your directory structure you installed Horizon from composer alone. Now you are trying to run command "php artisan horizon:install" but artisan is a tool from Laravel.
"horizon:install" supposed to copy all assets, configs etc to Laravel project - but again, you do not have any so there is not even where to copy it.
To summary.
Install Laravel.
Install Laravel Horizon.
Do cd until you're in the root folder of your project and run the command again. artisan file is in the root folder of a laravel project
This is driving me crazy second day. I'm new to Laravel and trying to get Laravel 6 work on Google App Engine Standard.
Tried: This tutorial and other ones, but it still fails to load Laravel index page
What I have done:
Created new Laravel project
Checked that Laravel is working on local host with php artisan serve
Generated new key with php artisan key:generate --show
Created app.yaml file with:
runtime: php72
env_variables:
APP_KEY: iktbUa2quYPV2av3zDx0XAuEVjwzVQY/oMfyI2PQNKk=
APP_STORAGE: /tmp
VIEW_COMPILED_PATH: /tmp
SESSION_DRIVER: cookie
Modified bootstrap/app.php by adding $app->useStoragePath(env('APP_STORAGE', base_path() . '/storage'));
Rancomposer remove --dev beyondcode/laravel-dump-server
Also ran:
php artisan cache:clear,
php artisan route:cache,
php artisan config:clear,
php artisan view:clear (as other tutorials suggested)
And gcloud app deploy
And I get error: "Class 'Facade\Ignition\IgnitionServiceProvider' not found"
If you're facing this issue after upgrading composer 1.0 to 2.0. Then you can follow this step:
Go to the project directory
Run composer install
Run composer dump-autoload
Try to run php artisan serve
It solved for me
Please Try
composer dump-autoload
It solved for me
App engine install dependency with "--no-dev" flag. If your application is debug mode and there is an error application is try to render error page by "facade/ignition" packages.
Solve-1: You can move "facade/ignition" dependency from "require-dev" to "dev" in composer.json file
Solve-2: You can run as production environment and with false APP_DEBUG flag
I have experienced other errors as well, most of them gave me Error 500 and
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /tmp/google-config/nginx.conf:3 in Stackdriver Logger
Also I was not aware that App Engine was executing composer.json on build (see Specifying Dependencies). And it seems the issue was that it cached that.
Everything was resolved by replacing command in step 7. :
gcloud app deploy with gcloud beta app deploy --no-cache
It seems that if I would have done all steps as in tutorial from the start I would not have any issues.
Try
php artisan route:clear
and you're good to go.
I try
composer update
and its working fine
Try running
composer update
or
composer dump-autoload
Go to your project terminal and run :
composer install
composer dump-autoload
php artisan serve
And your problem will go away.
I am also new to Laravel and I have experienced with this issue, and I searched solution which was
first run this command on your terminal
composer update
second run the command on below
composer dump-autoload
and then see the result :)
just uncomment soduim line from your ini file
before
;extension=sodium
after
extension=sodium
If you are facing this issue while running phpUnit tests then try to clear cache of bootstrap folder.
How to setup existing laravel 5 project and there database in Ubuntu 14.04 using xampp?
Some of things you need to consider for new setup. If you have setup git repo then
You can just pull from git If not copy/paste all folders except vendor, node_modules.
Use composer install to make vendor folder
Use npm install to make node_modules folder if you already using
Use php artisan migrate to make database structure
Use php artisan db:seed if you set any seeding to fill tables data
Use php artisan key:generate to make security.
Create/Update .env file to make work configuration from environment
Now you have to point your domain with root folder of laravel you created here.
I am new to laravel.
So, I have successfully installed and configured Homestead on my Windows machine.
Then I wanted to install Laravel. As I said, I am on Windows, so obviously I don't want to install php, composer and all that stuff on it, that's why I just hit "vagrant ssh" to get inside Homestead and then tried to install laravel following the official documention
composer global require "laravel/installer"
Then I tried to run "laravel" command, but no luck - command not found. I decided, that I had to edit PATH variable, but then I found out that there is no "~/.composer/vendor/bin" folder at all (not it inside /home/vagrant or /root).
and after I got stuck. What do I do wrong, guys?
P.S. "composer create-project --prefer-dist laravel/laravel blog" works fine, but I want to find out how to make "laravel" command work
I don't believe there is a laravel command-line executable.
Are you trying to run artisan commands?
docs
when you run composer global require "laravel/installer" what did it say ? it should output
Changed current directory to /home/vagrant/.config/composer where laravel will be installed
so you can just add /home/vagrant/config/composer/vendor/bin (note config vs what you say ~/.composer/vendor/bin) in your PATH variable and laravel command will work
I want to make use of auth system which comes with the laravel package but the problem is when I make new laravel package using composer i.e composer create-project laravel/laravel project name --prefer-dist
it do not install those auth resources which includes (i.e. auth folder inside resources > views) and also I can't find the Services Folder inside app directory.
All other things are working fine except this authentication system.
What can be the possible problems? Please give me solution
I am working with MAMP.
Taylor Otwell has made it opt-in for Laravel 5.1
You need to run following command after installation
php artisan scaffold:auth
UPDATE
I think this has been answered here
You could also run the command php artisan make:auth in the root directory of you laravel project. I had the same problem and it worked for me.
The command php artisan scaffold:auth didn't work for me i don't know why.
it issued the error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "auth" is not defined.
Did you mean this?
make:auth
in Laravel 5.2 you just have to run this command "php artisan make:auth" and the auth folder will be created
Since laravel 6.* version make:auth is no longer supported, use ui:auth instead.
For deploying ui pack run
composer require laravel/ui --dev
then update composer.json :
composer update -W
and do the:
php artisan ui:auth
You need execute
php artisan make:auth
now if your style css and js are missing
You need load file .css and .js
1) execute in your project
npm install
2) then execute
npm run dev => now in folder /public now exist folder js and css
3) reload page