问题
I am trying to use Firebird 3.0 from Laravel 6.0 and I am following https://firebirdsql.org/file/documentation/reference_manuals/fbdevgd-en/html/fbdevgd30-php-Laravel-crt-project.html where the package https://github.com/sim1984/laravel-firebird is suggested. Unfortunately, this package is intended for Laravel 5.7 (or maybe it has not been published in composer repositories) that is why I received the following message while I was trying to install this package:
[InvalidArgumentException]
Could not find a matching version of package sim1984/laravel-firebird. Check the package spelling, your version con
straint and that the package is available in a stability which matches your minimum-stability (dev).
So, I had this great ide to to fine tune this package that is why I forked it as https://github.com/alex153490/laravel-firebird, I changed the version requirements in its composer.json. I hope that there is not other work to be done to ensure the compatibility with Laravel 6. After that I added this git repository in the composer.json of my Laravel project:
"repositories": [
{
"type": "package",
"package": {
"name": "alex153490/laravel-firebird",
"version": "master",
"source": {
"url": "https://github.com/alex153490/laravel-firebird.git",
"type": "git",
"reference": "master"
}
}
}
]
Now the package was installed OK. I have created one model file in my Laravel project and I added the import
use Firebird\Eloquent\Model;
as was suggested by the original description of the original package.
But now I started to receive error
Symfony\Component\Debug\Exception\FatalThrowableError
Class 'Firebird\Eloquent\Model' not found
while trying to call this model class from the simple rest API controller of my project.
Why is this class not found error - the package was installed without error, the package sits inside the vendor folder of my project and all seems to be OK. I have checked the possible issues from the checklist https://dev.to/dechamp/php---how-to-fix-class--not-found-error-1gp9 , including I regenerated the autoload file for my project, but of no help.
What did I do wrong? Why it is so hard to make class visible from my package inside the vendor directory?
p.s. when I tried to use suggested Laravel-Firebird packages for Laravel 6 (https://packagist.org/packages/harrygulliford/laravel-firebird or https://github.com/KKSzymanowski/laravel-6-firebird) I always got the exception event for the most basic select statement:
Illuminate\Database\QueryException
SQLSTATE[HY000]: General error: -901 Dynamic SQL Error SQL error code = -901 feature is not supported (SQL: select * from "MY_TABLE")
It seems to me that the authors of the package has just provided data for the Firebird-specific grammar (includind the statements for the system data), but their ignored that Firebird can have some features missing for use from Laravel.
来源:https://stackoverflow.com/questions/60096332/laravel-6-can-not-found-vendor-class-from-the-fast-tuned-package-that-was-releas