Laravel artisan migrate ERROR - php

I trying to load data to the database via PHP artisan migrate command in laravel 4. But the terminal throws the following error:
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","me
ssage":"Call to a member function increments() on a non-object","file":"C:\xamp
p\htdocs\lartut\lartut\app\database\migrations\2014_04_17_072025_create-u
sers-table.php","line":15}}
Don't what's causing this error. Can Someone please help me with this.

This fixed my issue.
I used
php artisan migrate:install
before migrating the table. And it worked..........

Related

Laravel InvalidArgumentException in FileViewFinder.php line 137:

I want to open a Laravel project which I developed few years ago on my Xampp localhost. I copied the folder to Xampp/htdocs/myproject. I installed the composer and laravel too. When I open the project in browser I can't the following error:
InvalidArgumentException in FileViewFinder.php line 137:
View [index] not found.
I also tried to run the php artisan serve command but it does not work. It gives error:
could not open input file: artisan
It is better to clear the app cache after moving the project to other servers. Try these-
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
I hope it will help. :)

Can not run Seeding on Laravel

Docker 18.09.2
Mysql 5.7
Laravel 5.7
PHP 7.125
I am new at Laravel and I have a problem When I use php artisan db:seed, this error appeared:
include(/var/www/laravel_app/vendor/composer/../../database/seeds/AdminsTableSeeder.php):
failed to open stream: No such file or directory
at /var/www/laravel_app/vendor/composer/ClassLoader.php:444
440| * Prevents access to $this/self from included files.
441| */
442| function includeFile($file)
443| {
> 444| include $file;
445| }
446|
I have no idea why does it happens.
There was no error when I used php artisan migrate.
I have already tried php artisan migrate --seed and php artisan migrate:refresh --seed.
Can anyone please help me?
You should try using composer dump-autoload.
From this answer in SO:
Basically, because Composer can't see the migration files you are
creating, you are having to run the dump-autoload command which won't
download anything new, but looks for all of the classes it needs to
include again. It just regenerates the list of all classes that need
to be included in the project (autoload_classmap.php), and this is why
your migration is working after you run that command.

Laravel installation in Bluehost getting error Invalid argument supplied for foreach()?

I try to host my Laravel application in BlueHost i follow this tutorial LINK
i installed composer succesfully when i create new project in last line im getting this error
i tried php artisan command but its showing same error. can any one help on this Thank You.
This is how i solved my problem after the installation i used
php-cli artisan clear-compiled insted of php artisan clear-compiled
and we can use artisan command like this php-cli artisan ......

Laravel 5.2 php artisan migrate:rollback error

I use Laravel 5.2 and I created database tables by running
php artisan make:migration create_categories_table --create=categories
and
php artisan make:migration create_posts_table --create=posts
and then I run php artisan migrate, and tables are created in database. But after I made some changes in migration file "create_posts_table.php" and run
php artisan migrate:rollback
I got an error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'CreatePostsTable' not found
PHP Fatal error: Class 'CreatePostsTable' not found in E:\programfiles\xampp\htdocs\deneme\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php on line 336
my create_posts_table.php is
I tried composer update, composer dump-autoload but that hasn't fixed the problem.
I was getting the same problem. May this helps somebody: run composer dump-autoload before running migrate:rollback.
Before you run a migration, you should run the following commands to make sure cache has been cleared:
php artisan clear-compiled
php artisan optimize
This will make sure your new migration class has been registered correctly.

Laravel route list returns error

When i try to show list of available routes artisan returns the following error:
$ php artisan route:list
[ReflectionException]
Class API does not exist
It worked a while ago but now i can't get it to work.
Laravel version is:
$ php artisan -V
Laravel Framework version 5.1.10 (LTS)
Is it possible to debug somehow this error?
You can find what's wrong in the storage/logs/laravel-YYYY-MM-DD.log file.
Check it, resolve and run artisan again.
What's your php version ? I think, if you are under php5.5, then change the shell.

Categories