Remove pragmarx/tracker package from laravel project by the following composer command
composer remove pragmarx/tracker
It's remove successfully but the below error shown. Even though composer update the error not fix.
Illuminate\Contracts\Container\BindingResolutionException
Target class [PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker] does not exist.
How can I fix this error ? and which method to follow to completely remove any unused packages from laravel?
From the documentation on the repo:
Installing
Require the tracker package by executing the following command in your command line:
composer require pragmarx/tracker
Add the service provider to your app/config/app.php:
PragmaRX\Tracker\Vendor\Laravel\ServiceProvider::class,
Add the alias to the facade on your app/config/app.php:
'Tracker' => 'PragmaRX\Tracker\Vendor\Laravel\Facade',
Publish tracker configuration:
Laravel 4
php artisan config:publish pragmarx/tracker
Laravel 5
php artisan vendor:publish --provider="PragmaRX\Tracker\Vendor\Laravel\ServiceProvider"
Enable the Middleware (Laravel 5)
Open the newly published config file found at app/config/tracker.php and enable use_middleware:
'use_middleware' => true,
Add the Middleware to Laravel Kernel (Laravel 5)
Open the file app/Http/Kernel.php and add the following to your web middlewares:
\PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker::class,
...
If you removed the package, make sure to
delete the config/tracker.php file
remove the line PragmaRX\Tracker\Vendor\Laravel\ServiceProvider::class from config/app.php
remove the line 'Tracker' => 'PragmaRX\Tracker\Vendor\Laravel\Facade', from config/app.php
remove the line \PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker::class, from app/Http/Kernel.php
I've developed Laravel Project in my local computer.
I used Yajra Pakagebox for using bootstrap datatables on it.
Like this :
composer require yajra/laravel-datatables-oracle
php artisan vendor:publish
Then I pushed them all into Hosting Server but it displays errors like below.
(1/1) FatalThrowableError
Class 'Yajra\DataTables\DatatablesServiceProvider' not found
in ProviderRepository.php (line 208)
at ProviderRepository->createProvider('Yajra\\DataTables\\DatatablesServiceProvider')
in ProviderRepository.php (line 144)
at ProviderRepository->compileManifest(array('Illuminate\\Auth\\AuthServiceProvider', 'Illuminate\\Broadcasting\\BroadcastServiceProvider', 'Illuminate\\Bus\\BusServiceProvider', 'Illuminate\\Cache\\CacheServiceProvider', 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider', 'Illuminate\\Cookie\\CookieServiceProvider', 'Illuminate\\Database\\DatabaseServiceProvider', 'Illuminate\\Encryption\\EncryptionServiceProvider', 'Illuminate\\Filesystem\\FilesystemServiceProvider', 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider', 'Illuminate\\Hashing\\HashServiceProvider', 'Illuminate\\Mail\\MailServiceProvider', 'Illuminate\\Notifications\\NotificationServiceProvider', 'Illuminate\\Pagination\\PaginationServiceProvider', 'Illuminate\\Pipeline\\PipelineServiceProvider', 'Illuminate\\Queue\\QueueServiceProvider', 'Illuminate\\Redis\\RedisServiceProvider', 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider', 'Illuminate\\Session\\SessionServiceProvider', 'Illuminate\\Translation\\TranslationServiceProvider', 'Illuminate\\Validation\\ValidationServiceProvider', 'Illuminate\\View\\ViewServiceProvider', 'Yajra\\DataTables\\DatatablesServiceProvider', 'Laravel\\Tinker\\TinkerServiceProvider', 'App\\Providers\\AppServiceProvider', 'App\\Providers\\AuthServiceProvider', 'App\\Providers\\EventServiceProvider', 'App\\Providers\\RouteServiceProvider'))
in ProviderRepository.php (line 61)
The important thing is I can't execute any command on Hosting Server because it is Shared Hosting Server.
I saw many articles for solving this problem but they are all using "artisan" and "composer" command.
But I can't use this command at all.
I can only upload the source code to server with FTP.
Depending on what version of DataTables you are using, it may be simple capitalization issue. After version 8 you should use:
Yajra\DataTables\DataTablesServiceProvider
Before version 8 use:
Yajra\Datatables\DatatablesServiceProvider
Upgrade notes reference: https://yajrabox.com/docs/laravel-datatables/master/upgrade#namespace
Please run below command and try:
composer update
composer dump-autoload
php artisan config:cache
php artisan cache:clear
It is working for v#8.3
Yajra\DataTables\DataTablesServiceProvider::class,
'Datatables' => Yajra\DataTables\Facades\DataTables::class,
Please add this to the config/app.php file.
The first line goes under the "Package Service Providers" section
and the second line goes under the "Class Aliases" section
replace Datatables with DataTables
Re install with the plugin along with the buttons plugin and now it's working.
composer require yajra/laravel-datatables-buttons:^3.0
In the project's folder
rm -R vendor/
rm -R bootstrap/cache
mkdir bootstrap/cache
chmod -R 777 bootstrap/*
if your laravel version => 5.4
composer require yajra/laravel-datatables-oracle:"~8.0"
if your laravel version => 5.8
composer require yajra/laravel-datatables-oracle:"~9.0"
#config/app.php
'providers' => [
...,
Yajra\DataTables\DataTablesServiceProvider::class,
]
'aliases' => [
...,
'DataTables' => Yajra\DataTables\Facades\DataTables::class,
]
composer dumpautoload
composer install
It works for me.
Source: https://github.com/yajra/laravel-datatables[https://github.com/yajra/laravel-datatables][1]
REASON ITS NOT WORKING IS:
you installed the library. and added it in config/app.php in providers array.
don't forget to run
php artisan vendor:publish
after that.
Try below steps to resolve this issue:
Use composer show to check which version of packages you are using.
Delete all files under bootstrap/cache folder
Delete vendor folder and reinstall all packages using composer install.
all the files you know you're changing to ftp (migrations config controller...)
and replaced local files to server with ftp
/composer.json
/composer.lock
/bootstrap/*
/storage/framework/cache/*
/storage/framework/views/*
/vendor/composer/*
/vendor/autoload.php
If the problem persists, I'm need to relay the version of the Laravel.
Tested with
php artisan --version
Laravel Framework 5.4.19
In your [config/app.php] file, edit the aliases array. Change it from
'Datatables' => Yajra\Datatables\Facades\Datatables::class
to
'Datatables' => Yajra\Datatables\DatatablesServiceProvider::class
Need Help to integrate Admin Lte theme in la ravel 5.4 , i try to integrate it but it show black pages.
Download laravel project folder by using:
composer create-project --prefer-dist laravel/laravel laravelLTE
Create database named :laravel and make database related changes in .env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=null
Goto the folder path
/var/www/html$ cd laravelLTE
To run all of your outstanding migrations, execute the migrate Artisan command:
/var/www/html/laravelLTE$ php artisan migrate
In case of string error make changes in following page :
/var/www/html/laravel/app/Providers/AppServiceProvider.php
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
Inorder to install Admin Lte theme hit following commands in your terminal:
composer require "acacha/admin-lte-template-laravel:4.*"
composer update
To register the Service Provider edit the file
config/app.php
And add following line to providers array:
Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider::class,
To Register Alias edit the file
config/app.php
And add following line to alias array:
'AdminLTE' => Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::class,
Get configuration file in your application from vendor package file.
/var/www/html/laravelLTE$ php artisan vendor:publish --tag=adminlte –force
/var/www/html/laravelLTE$ php artisan serve
thank you
I hope this will help you to integrate adminLTE theme
What is the best solution if I want to rename my laravel 5.1 project, I just tried to rename one but it did not work properly got some errors.
Are there some kind of steps one has to do to rename a laravel project?
You should use php artisan app:name command to rename your app. It will change namespace in all project files for you. This is the only right way to rename your app.
https://laravel.com/docs/5.0/configuration#after-installation
From laravel version 5.3^ there is a function to call the app name
config('app.name');
You can change the default name 'Laravel' inside this file
config/app.php
'name' => 'Laravel',
And also inside .env file
APP_NAME=Laravel
I just recommend to:
go to .env file at APP-NAME =
put your desired name in "" (double quotes)
restart your server
And you're done.
You can change your project name using the following command:
php artisan app:name your_git_name\your_app_name
I have web-app on Laravel and I tried to update yajra/datatables to last version, so it needed
'Maatwebsite\Excel\ExcelServiceProvider'
I tried composer update, so it didn't help.
Now I removed this line from composer.json
But on calling php artisan clear-compiled
It shows me an error:
PHP Fatal error: Class 'Maatwebsite\Excel\ExcelServiceProvider' not found in /var/www/html/talimger.xyz/vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 575
Show where I should remove this Maatwebsite files
`
The instructions at https://github.com/Maatwebsite/Laravel-Excel tell you what to do, but not how to do it. The assumption is that you already know a bit about composer.
Here's the 'how to do it'...
1) Remove the service provider entries you made and delete any lines you added to composer and then type the following:
composer require "maatwebsite/excel"
2) After updating composer, add the ServiceProvider to the providers array in config/app.php
Laravel 5.1:
'Maatwebsite\Excel\ExcelServiceProvider',
Laravel 5.2:
Maatwebsite\Excel\ExcelServiceProvider::class,
3) You can use the facade for shorter code. Add this to your aliases:
Laravel 5.1:
'Excel' => 'Maatwebsite\Excel\Facades\Excel',
Laravel 5.2:
'Excel' => Maatwebsite\Excel\Facades\Excel,::class
Comment out 'Maatwebsite\Excel\ExcelServiceProvider' from the providers array in app.php under config then run composer update when you are done then your uncomment it.