Laravel VerifyController does not exist - laravel-5.8

when write artisan command to see route list then saw verifyController does not exist
php artisan route:list
Class App\Http\Controllers\VerifyController does not exist
How can i solve this problem?Help me.Thanks.

I think you have "Route::get('some-route', 'VerifyController');" in routes/web.php and dont have VerifyController.php in App/Http/Controllers
You should create "VerifyController.php" or remove Route::get('some-route', 'VerifyController');" this line from routes/web.php

Related

Laravel Route exist in artisan route:list but not in route files

When I am checking php artisan route:list, the route which i want to redirect is listed there.
for ex: admins.dashboard.panel
but I didn't found any related route in route code files.
And I have code in my LoginController as
return redirect()->route('admins.dashboard.panel');
which is redirecting to login page again.

Laravel 5.4 - Artisan make:controller XxxController --resource --model=Xxx not identifying Model driectory genereted by reliese/laravel

I have a database that already is in use when I started a new API in Laravel 5.4.
For this reason, instead of use Migrations, I have used reliese/laravel to generate the Models from my database.
The point is that reliese have created models inside app/Models/. So I have a table that was converted into app/Models/City.php for example.
So when I try to create a Controller using Artisan like this:
php artisan make:controller CityController --resource --model=City
I get this error:
A App\City model does not exist. Do you want to generate it? (yes/no) [yes]:
Because Artisan is searching the Model City.php inside app/ folder.
Is there a way to make Artisan to point to app/Models instead?
This is more elegant
php artisan make:controller CityController --resource --model=Models/City
I will share here what I did:
php artisan make:controller CityController --resource --model=Models\\City
Controller created successfully.
I had to use double backslash "\" without the app\ folder.

PHP artisan migration error

When i m executing PHP artisan migrate I'm getting following error
C:\xampp\htdocs\Social>php artisan migrate help
[ErrorException]
include(C:\xampp\htdocs\Social\vendor\composer/../../app/Http/Controllers/A
uth/AuthController.php): failed to open stream: No such file or
directory
C:\xampp\htdocs\Social>php artisan migrate
[ErrorException]
include(C:\xampp\htdocs\Social\vendor\composer/../../app/Http/Controllers/A
uth/AuthController.php): failed to open stream: No such file or
directory
C:\xampp\htdocs\Soci
how to solve this problem please help???
It looks like you're trying to use Laravel auth system by adding Auth::routes(); (Laravel 5.3+) or Route::auth(); (Laravel 5.2) to the routes file, but you didn't create controllers and views. So, you'll need to remove the line from the web.php and run this command:
php artisan make:auth
After that put Auth::routes(); back to the web.php. Or Route::auth(); to the routes.php if you're using Laravel 5.2 and lower.
https://laravel.com/docs/5.4/authentication#authentication-quickstart
Run composer install in your root project folder (or php composer.phar install)

Laravel 5.2.2 and Entrust error call to undefined method

When I am using latest Laravel 5.2.2 and Entrust ("zizaco/entrust": "5.2.x-dev") I face this error and not sure how to solve this:
Call to undefined method Zizaco\Entrust\EntrustServiceProvider::hasRole()
I tested this code on HomeController.php
use Entrust;
class HomeController extends Controller
{
public function index()
{
if (Entrust::hasRole('admin')) {
echo "string";
}
return view('home');
}
}
This is my config/app.php service provider
Zizaco\Entrust\EntrustServiceProvider::class
config/app.php facade alias
'Entrust' => Zizaco\Entrust\EntrustFacade::class
I also already generate the model needed
Did I miss something here?
I have same issue, here are the steps I have taken to solve the issue
In your .env file change to cache array
CACHE_DRIVER=array
and dont forget to run
php artisan config:cache
It seems all the steps is correct, and I just need to clear the cache with php artisan config:cache
And if you face an error like below
BadMethodCallException in vendor\laravel\framework\src\Illuminate\Cache\Repository.php line 380:
This cache store does not support tagging.
You need to change in .env this line to array
CACHE_DRIVER=array
Try this:
Open environment file of your laravel change CACHE_DRIVER=file to CACHE_DRIVER=array and save.
Now try your CLI command.
Laravel drivers does not support tagging. To solve this, go to your .env file and change
Cache_driver=file
to
Cache_driver=array
and run
php artisan config:cache

How to use artisan to make views in laravel 5.1

I have been looking in the docs for a solution to make views with basic CURD operations but without much success.
I guess this might be pretty simple, but am missing something or not looking hard enough.
i can make models and controllers using the below artisan commands
php artisan make:model modelName
php artisan make:controller controllerName
But how do we make the basic CURD views. something like
php artisan make:views
cant find any doc for this. Please help
At the time of writing, there isn't a way to create views via artisan without writing your own command or using a third party package. You could write your own as already suggested or use sven/artisan-view.
if you are using laravel 5.1 or 5.2 this gist can help you make:view command just create command copy and paste the code from gist.
Step 1:
php artisan make:command MakeViewCommand
Step 2:
copy class from this gist
https://gist.github.com/umefarooq/ebc617dbf88260db1448
Laravel officially doesn't have any Artisan cammands for views.
But you could add third party plugins like Artisan View
Here's the link Artisan View
After adding this plugin to your project by the guide provided here you should be able to perform following cammands :
Create a view 'index.blade.php' in the default directory
$ php artisan make:view index
Create a view 'index.blade.php' in a subdirectory ('pages')
$ php artisan make:view pages.index
Create a view with a different file extension ('index.html')
$ php artisan make:view index --extension=html
There is very easy way to create a view(blade) file with php artisan make:view {view-name} command using Laravel More Command Package.
First Install Laravel More Command
composer require theanik/laravel-more-command --dev
Then Run
php artisan make:view {view-name}
For example
It create index.blade.php in resource/views directory
php artisan make:view index
It create index.blade.php in resource/views/user directory
php artisan make:view user/index
Thank you.
In v5.4 you need to create the command with:
php artisan make:command MakeView
and before you can use it, it must be registered in App/Console/Kernel like
protected $commands = [
Commands\MakeView::class
];
then you make a view like: php artisan make:view posts/create
To create a view (blade) file through command in laravel 8:
composer require theanik/laravel-more-command --dev
php artisan make:view abc.blade.php
You can install sven/artisan-view package to make view from CMD, to install package write this command:
composer require sven/artisan-view --dev
After installing it, you can make a single view or folder with all views that contain {index-create-update-show}
To make a single file we using this command:
php artisan make:view Name_of_view
For example
php artisan make:view index
To make a folder that contain all resources index - create - update - show write name of folder that contain all this files for example:
php artisan make:view Name_of_Folder -r
For example:
php artisan make:view blog -r
-r is a shorthand for --resource you can write full name or shorthand to make resource.
you can extend yields from master page if master page inside in directory layouts we write command sith this format
php artisan make:view index --extends=layouts.master --with-yields
layouts is a directory this directory may be with a different name in your project the idea is name_of_folder/master_page that you want to extend yields from it.
For more view docs

Resources