Laravel 5.6 mac osx make:migration command doesnt do anything - php

Just installed laravel 5.6 and made a new project php artisan make:migration create_posts_table doesnt do anything not even showing results in terminal and doesnt make the php file in migrations , my php version is 7.1 and i tried reinstalling. thanks for help

Using laravel new blog for making a new project doesnt include .env and some other files which causes php artisan commands to fail and with composer create-project --prefer-dist laravel/laravel blog it just got fixed.

Related

Laravel 8 - Bootstap ui does not install

In my Laravel 8 application, after installing laravel ui, when I try to run 'php artisan ui bootstrap' I get the following error:
In Bootstrap.php line 70:
copy(C:\xampp\htdocs\netlytics\resources\js/bootstrap.js): Failed to open stream: No such file or directory
I have run composer update successfully.
I have laravel/ui version 3.2.0. I am running Laravel 8.40.0 with PHP 8.0.3.
The site is an old site that I upgraded from Laravel 5.3 and PHP 5.6.
The pre-processing was being done using gulp with a gulpfile.js to configure the mix conversions.
With Laravel 8 I know I need to update my pre-processing to use webpack.mix.js, but so far can't get there.
There is supposed to be a resources/app/bootstrap.js file but it is not showing up and I do not know what it should look like if I wanted to put it there.
Any ideas how to get this installed correctly?
I poked around and finally discovered that I needed to install jQuery and jQuery-ui as well as popper.js. I installed those and again got the same error, but this time I just created a resources/app/bootstrap.js file and when I ran 'php artisan ui bootstrap' it ran and populated the bootstrap.js file.
Here solution:
https://stackoverflow.com/a/68393896/15391779
composer create-project laravel/laravel --prefer-dist laravel-bootstrap
composer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run dev

Laravel 8 UI issue

I have installed Laravel 8 as a new project. When I run the project I get the "In order to use the Auth::routes() method, please install the laravel/ui package." But Laravel installation doc says that laravel ui is depreciated and that we should use Jetstream. So I installed Jetstream with the Livewire stack. Back to test the project and I get the same error msg.
I have run a composer dump-autoload.
What do I have to do to get a Laravel 8 project to run?
You will need to clear and recreate cache. Run the following php artisan commands:
php artisan cache:clear
php artisan config:cache
php artisan route:cache
I had this problem as well on many 'upgrades' from earlier versions of Laravel. I don't want to change the entire auth mechanism, as it works, so I will keep the code I have.
#Elisha Senoo's answer is correct, and solved it most of the time. However, if you find yourself unable to clear the cache (because it has the same error message on the artisan command), the solution is to manually clear the .php files within the bootstrap/cache folder and then php artisan config:cache.

Cannot run artisan command in Laravel Homestead

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

Laravel 5.5 - Issues creating new project

I'm trying to use Laravel 5.5. I updated my php 7.0 to php 7.1. Even, I update my laravel installer package. But, when I try to do:
laravel new myProject
I get this error:
You made a reference to a non-existent script #php -r
"file_exists('.env') || copy('.env.example', '.env');" You made a
reference to a non-existent script #php artisan key:generate
Illuminate\Foundation\ComposerScripts::postAutoloadDump You made a
reference to a non-existent script #php artisan package:discover
I am using laravel valet and if I go to the browser, when I try myProject.dev is not working. I see this error:
Whoops, looks like something went wrong.
I tried using:
php artisan key:generate
inside my project, but I got that:
[ErrorException]
file_get_contents(/Users/jorgeJimenez/Sites/laravel5-5/.env): failed
to ope n stream
: No such file or directory
I noticed, my laravel 5.4 projects are working. I copied a .env file and I put on my laravel 5.5 projects. After that, I run
php artisan key:generate
and the key was generated and my project in the browser works.
It's supposed, all that process is automatic, but I am not quite sure what is happening.
You can try update your composer:
composer self-update
I had the same problem. Then I found that there was no problem when i created the first project use laravel 5.5. so I clear composer's cache dir. It works well now.
This is because of your Laravel Installer or Composer version. I have faced the same problem and found following 2 different solutions:
Generally you can solve with by running composer global update command and then run composer update command from your project directory. This solution basically updates your installer and then your project.
If still, you have this issue, you need to run composer self-update command first and then run composer update command from your project directory. Here your composer will update and then your project.
Hope this answer will help you.

migration creation error in laravel

I am relatively new to laravel framework.I was going through some tutorials and i tried the following command.
php artisan make:model User -m
Above shows the output that i recieved on the console.I do get that it's something related to the path but how do i resolve this error?
I solved this problem by doing this :
php composer.phar dump-autoload
Then php artisan make:model User -m
It would work like a charm and do remember, composer.phar should be in the same folder , where the composer.json file lies.

Categories