Where do I run "php artisan make:migration posts" on WIndows? - php

I am following this tutorial: http://www.findalltogether.com/tutorial/simple-blog-application-in-laravel-5-part-1-setup-database/ to set up a Blog using Laravel.
In the tutorial, it says to make migrations I've to run php artisan make:migration posts. Where do I run this? I tried bash but received the error: Could not open input file: artisan.
I'm on Windows, using xampp - could this be a reason?
Thank you

You have to go in folder where artisan is located (usally root of project) and with CMD or CONSOLE write php artisan make:migration posts

First Navigate to your project directory from command prompt if you have installed the laravel in your project so there should be artisan available you may find by typing "dir" once you find artisan there you should run your respective command. Moreover once you reached to your project directory for testing purpose you may write this line
" php artisan " (without quotes) and press enter you will see all the list of commands available in artisan.
Thanks

Related

How add Artisan cli to existing laravel project?

I have issue with Artisan usage on Windows 10 with Xampp.
What have I done:
clone project from git repositiory
run composer install
In directory with project i trying run:
php artisan
but i get errror:
Could not open input file: artisan
But if i run command
php bin/console i get list of command like cache, debug, eloquent... so some tools are there... But none artisan...
How i can add/use artisan into existing project?
Check if artisan file exists in your project root folder. If it does, then you're probably on the wrong folder. If it doesn't exist, you can just download it from the official repo.
To configure an existing project, you'd typically check those things first :
You should goto app/config/database.php check file and verify username and password.
After check in Project Folder vendor folder and composer.json file exist then remove it (that remove old configuration now we going to fresh configuration).
Then after back to command prompt and fire command composer update and that download some dependent file download.
Now Run php artisan serve

file_put_contents error on existing laravel project

I am trying to configure a new laravel project however I always get the following error no matter what:
file_put_contents(C:\Users\bla...\Documents\GitHub\project\storage\framework/sessions/yB2Ji8maEDu0fXZLpZ5VBnDzIhLdaeA7aYdVMjOf): failed to open stream: No such file or directory
I have tried re installing homestead/laravel/vagrant I have also ran the following and more artisan command again and again:
php artisan config:cache
php artisan cache:clear
php artisan optimize
I have also ran chmod privileges on files/folders inside of my vagrant box but still nothing gets me past this error, any ideas? The project itself is created perfectly fine inside of my vm.
Delete all the files in yourProject/storage/framework/sessions, then run php artisan view:clear and php artisan config:clear

php artisan command does not work anymore

I have a laravel project based on version 5.4.
today I found that php artisan does not work any more and for all commands return this error :
Could not open input file: artisan
This is while working well before and have not any problem.
Of course in other laravel project all things worked find and There is no problem.
I have searched in google and I have reviewed a lot of topics But none of their solutions resolved the problem.
Update:
I found that there is not any artisan file in root directory. I do not know what happened.
Also I downloaded artisan file from https://raw.githubusercontent.com/laravel/laravel/master/artisan and add to my project but problem not solved.
I've had this issue a few times here are the steps I'd take to triage the cause you can run artisan in order:
Ensure you are in the root path of the laravel project and that the artisan file exists in that path. If you aren't in the path that contains the artisan executable (the root of your laravel project) you will get this error. If you aren't in the root path of your laravel project you'll see this
┌─[admin#nfml-5YF]─(~)
└─[18:24]$ php artisan
Could not open input file: artisan
Ensure your artisan file has the right file permissions (should be 644 on linux). (I changed it to 222 just to show reproduce an issue).
Check the file's current permissions.
┌─[admin#nfml-5YF]─(/reviewrail)
└─[16:49]$ stat -f '%A %a %N' artisan
222 1527108561 artisan
If you run artisan without execute permissions, you will get the error you reference.
┌─[admin#nfml-5YF]─(/reviewrail)
└─[16:49]$ php artisan inspire
Could not open input file: artisan
If change file permissions to 644. Give it another shot and it should work.
┌─[admin#nfml-5YF]─(/reviewrail)
└─[16:50]$ chmod 644 artisan
┌─[admin#nfml-5YF]─(/reviewrail)
└─[16:50]$ php artisan inspire
Genius is one percent inspiration and ninety-nine percent perspiration. - Thomas Edison

How to Open Laravel project

I have created(installed composer create-project laravel/laravel basicwebsite) project named basicwebsite.
After that i run php artisan serve then it showed some URL then i got LARAVEL page in browser,fine.
(Accidentally, my system is shut down.)
To reopen the project ,in cmd prompt i just did as
php artisan serve
and the error occur is
I almost searched for solution in all websites(including stack) .All started with create project but not what to do after close and opened the project.
Thanks in advance.
Use php artisan config:clear command to clear cache. You should see
Configuration cache cleared
Use php artisan serve command to start the server.

How do I remove old artisan command from Kernel in Laravel 5

I have created some Command files into my Laravel Application. Laravel version is 5.2. I set command like: get:email in the Command file. Also call the Command file into Kernel.php. After that I can see the artisan command list by typing the command php artisan list. as like as below:
//output
get:email
And I changed the command title get:email to get-bq:email. When I run the command php artisan get-bq:email -- its working nicely. Also I can see the list by typing the command php artisan list::
//output
get-bq:email
Issue / Problem: Both commands are working. But I won't to work with both of them. I have done the following things:
modified command file as well as command
run composer dump-autoload -o
run composer update
remove vendor and storage folder then run composer update again.
Still the old command is working into my system.
What I want: How May I remove my old commands from my Laravel(5.2) application?
Run these commands:
php artisan cache:clear
php artisan config:clear
These commands will clear app cache and config cache and recreate it.
I've had the same problem recently.
Repoeatedly tried
php artisan cache:clear
php artisan config:clear
and the cached Kernal command wouldn't clear.
In desperation i killed the queue worker terminal and restarted the queue with the command
php artisan queue:work
The issue stopped.

Categories