laravel 5.7 "Class 'Maatwebsite\Excel\ExcelServiceProvider' not found" - laravel

On my localhost is fine, but when i upload on my server i got this error:
"Class 'Maatwebsite\Excel\ExcelServiceProvider' not found"
My config/app.php:
'providers' => [
...
/*
* Package Service Providers...
*/
Maatwebsite\Excel\ExcelServiceProvider::class,
..
],
'aliases' => [
...
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
],
my laravel version is 5.7

Try running composer dump-autoload in your command line

Related

How to integrate smartystreet with laravel

I want to integrated smartystreets with my laravel project but am not able to do so.
I have tried this link , but it throw me error "Undefined constant 'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsServiceProvider'" when i run "$ php artisan vendor:publish".
Any help would be appreciated.`
Change in step 2 of the above link worked for me:
change this:
'providers' => array(
...
'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsServiceProvider',
)
'aliases' => array(
...
'SmartyStreets' => 'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsFacade',
)
to this:
'providers' => [
...
FireEngineRed\SmartyStreetsLaravel\SmartyStreetsServiceProvider::class,
],
'aliases' => [
...
'SmartyStreets' = > FireEngineRed\SmartyStreetsLaravel\SmartyStreetsFacade::class,
],
Note:Add the SmartyStreets providers and aliases element at the end of the both array.

laravel class not found - Class 'GoogleMaps' not found

I am using https://github.com/alexpechkarev/google-maps package with laravel 5.4 to create a google map and get driving distance from one point to another,
But When i call this function,
Symfony \ Component \ Debug \ Exception \ FatalThrowableError
(E_ERROR) Class 'GoogleMaps' not found
d
$d['a'] = \GoogleMaps::load('geocoding')
->setParamByKey('place_id', 'ChIJd8BlQ2BZwokRAFUEcm_qrcA')
->get();
I have installed the package via
composer require alexpechkarev/google-maps:1.0.8
and added aliases,'providers' in config/app.php
'providers' => [
...
'GoogleMaps\ServiceProvider\GoogleMapsServiceProvider',
]
'aliases' => [
...
'GoogleMaps' => 'GoogleMaps\Facade\GoogleMapsFacade',
]
why am i getting this error,Cannot find a way around it,Does anybody have an answer
You are registering the providers and alias wrong. Try this in config/app.php
'providers' => [
GoogleMaps\ServiceProvider\GoogleMapsServiceProvider::class,
]
'aliases' => [
'GoogleMaps' => GoogleMaps\Facade\GoogleMapsFacade::class,
]

Class 'Form' not found in Laravel 5.3?

In Laravel 5.2 form class in app.php is:
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
But this code not work in Laravel 5.3.
How to add class Form in Laravel 5.3 ?
Its called the Laravel Collective package and It has been removed from laravel defaults.
You can still integrate and use it.
here is the documentation
Laravel Collective
How to Install
composer require "laravelcollective/html":"^5.3.0"
Next, add your new provider to the providers array of config/app.php:
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
Finally, add two class aliases to the aliases array of config/app.php:
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
1st step install this via composer
composer require "laravelcollective/html":"^5.3.0"
Laravel Collective here
2nd step add this line in config/app.php under providers
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
3rd step
add this 2 line in config/app.php under aliases array
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
final step then link your html and css this way
{{ Html::style('css/demo.css') }}
{{ Html::script('js/demo.js') }}

Laravel 5 Form not found fatal error

I have done following process for resolving the error.
-I have added "illuminate/html": "5.*" to composer.json and ran "composer update"
-I have added following to config/app.php
'Illuminate\Html\HtmlServiceProvider',
'Form' => 'Illuminate\Html\FormFacade',
'Html' => 'Illuminate\Html\HtmlFacade',
- but my whole project is not working.Not running.It seems that it is composer issue.
Please help.
If i am correct the illuminate/html package isn't supported in laravel 5 anymore. There is a community fork at laravelcollective/html, see their site for all documentation.
You could swap the illuminate package for the laravelcollective package:
Add to your composer.json:
"require": {
"laravelcollective/html": "5.1.*"
}
Add provider to the providers array of config/app.php:
'providers' => [
Collective\Html\HtmlServiceProvider::class,
],
Add two class aliases to the aliases array of config/app.php:
'aliases' => [
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
],

Laravel 5.1.4 Entrust set up

I have problems with setting up entrust with L5..1.4
this is what i do:
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Zizaco\Entrust\EntrustServiceProvider::class,
and this: ....
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Entrust' => Zizaco\Entrust\EntrustFacade::class,
And its not working ... crashes my whole php artisan (when i run php artisan):
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Foundation\Application::bindShared()
i used this to install entrust:
"zizaco/entrust": "dev-laravel-5"
and then composer update. Now EntrustServiceProvider is under vendor/zizaco/entrust/src/entrust/ ...
any ideas?
After adding
"zizaco/entrust": "dev-laravel-5"
to your composer.json file run:
composer install
Next in the config\app.php add to the providers array:
'Zizaco\Entrust\EntrustServiceProvider',
and under the aliases array add:
'Entrust' => 'Zizaco\Entrust\EntrustFacade',
next run:
php artisan entrust:migration
this will generate the Entrust migration and finally run the migrations:
php artisan migrate
you should now be on your way! For more information check out:
https://github.com/Zizaco/entrust

Resources