The error is:
Class '\Omnipay\FirstData\Gateway' not found
after request Omnipay in laravel php project.
Related
This question already has answers here:
Error “Target class controller does not exist” when using Laravel 8
(27 answers)
Closed 2 years ago.
I'm new learning Laravel. I following a tutorial on Laravel 5.2 where using PostsController. I followed the method,
I comment out all code in routes/web.php and put on
Route::get('/post','PostsController#index'); line.
then I edited the PostsController file and put this "its working" inside the index function.
public function index() { return "its working"; }
Not showing the line in screen.
but showing errors.
C:\xampp\htdocs\blog
Illuminate\Contracts\Container\BindingResolutionException
Target class [PostsController] does not exist.
http://127.0.0.1:8000/post
What should I do now ? Any solution and any other way ?
Here's the error screenshot
first check your php version
php artisan -v
check your laravel version if your version is not same then go to laravel official doc and write web file accordingly to your laravel version.
also check your controller name is it same in web and controllers
I'm using datatables with laravel 5.4, but when I use the datatables()->query():
in providers: Yajra\Datatables\DatatablesServiceProvider::class,
in aliases: 'Datatables' => Yajra\Datatables\Facades\Datatables::class,
My code:
return Datatables()->query( /**query**/ )
return this error in my console:
FatalThrowableError
App\Http\Controllers\Datatables()
I've tried datatables() and Datatables()
Someone with the same problem?
This error happens because Laravel cannot find your package Datatables.
Laravel in controllers, if you are not mapping your classes correctly will always seek the called classes at this point App\Http\Controllers.
Just put use DataTables; or use \Yajra\Datatables\Datatables; at the start of your controller and it shall be fixed. documentation
When you install any package through composer, composer uses namespace to find the package and route functions and classes to it.
you can read more about the namespaces from php.
and you can check this tutorial for namespaces.
Also, Laravel follows the PSR 4 when it comes to autoloading, you can check it from here
In Laravel 5.4 have included Composer package "erusev/parsedown": "~1.6"
https://github.com/laravel/framework/blob/5.4/composer.json#L22
But how I can use this class in controller?
I have solved this Question to use parsedown in controller laravel 5.4, we only initial parsedown class without use namespace like this:
$parsedown = new \Parsedown();
$md = $parsedown->text('# this H1 tag');
I implement laravel/socialite with laravel 5.2 and an error occur that is :
"InvalidStateException in C:\xampp\htdocs\facebook\vendor\laravel\socialite\src\Two\AbstractProvider.php line 191:"
why was this occur and how am i solve this?
I have a little project on Laravel 5.1
And I updated it to 5.2
And now I get this error from my model:
Class 'Input' not found
And this is the code :
if ( \Input::get('angular') ) { ... }
And where do I find it in the documentation ?
I'm new with Laravel
And I didn't find it
Thanks for the help
You need to use:
\Request::input('angular')
instead of
\Input::get('angular')
Reference: Laravel 5.2 Request documention