php artisan make:controller throws: method controller doesnt exists - laravel

I'm trying to create a controller on an Homestead install for Laravel.
If I try:
php artisan make:controller test
I get
[BadMethodCallException]
Method controller does not exist.
php version is 7, php artisan --version = 5.3

oh just writing the question I discovered an error in routes.php.
Corrected the error now everything is fine...

Related

Laravel, Jenssegers & Cashier: Call to a member function prepare() on null

When using Laravel with Jenssegers/MongoDB and Cashier, I receive the error:
Call to a member function prepare() on null.
Browse to laravel/vendor/cashier/src/
Open both subscription.php and subscriptionItem.php and change
use Illuminate\Database\Eloquent\Model;
to
use Jenssegers\Mongodb\Eloquent\Model;
remove the composer.lock and run this command
composer require jenssegers/mongodb
after that run these command as well:
composer dump-autoload
php artisan cache:clear
php artisan view:clear
php artisan config:clear
and restart your server. also, make sure you have installed the latest version of composer.

php artisan tinker problem on laravel homestead

Thinker is not working on laravel homestead (laravel 6.9, php 7.4). When I try to use php artisan tinker I get this error:
Symfony\Component\Debug\Exception\FatalThrowableError : Class 'XdgBaseDir\Xdg' not found
Looks like some of your code is requiring the Xdg library, so can you try adding it
composer require dnoegel/php-xdg-base-dir

Class DataTable not found in laravel

I try to install Laravel DataTable and after I run command
php artisan vendor:publish
and then it get error and I use laravel 5.4
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Yajra\Datatables\DatatablesServiceProvider' not found

PHP Artisan Tinker not working with Laravel 5.5.16

I run php artisan tinker but it didn't work it just show a message like this
c:\xampp\htdocs\app_tpa>php artisan tinker
[ErrorException]
rmdir(C:\Users\KIMUNG~1\AppData\Local\Temp\php-xdg-runtime-dir-fallback-): Directory not empty
I tried to run composer require laravel/tinker, but it doesn't fix my problem
This issue is now resolved as per these github issues:
laravel/tinker#29
bobthecow/psysh#430
The proper solution now is to do composer update

php artisan make:middleware OldMiddleware returns 'there are no commands defined in the 'make' namespace

I'm trying to create middleware in Laravel 4.2 when I run
php artisan make:middleware OldMiddleware
it returns 'there are no commands defined in the 'make' namespace'
however migrate command works
when I run
php artisan list
it shows me the list of command but there is no 'make' command indeed
?
I got this command : php artisan make:middleware OldMiddleware from official laravel website -
make:middleware artisan command was added in Laravel 5.0. It seems that you're running some older version of Laravel. If you want to use this command, upgrade to Laravel 5.0.

Resources