Hi,
I've installed Laravel Medialibrary 8 on a new Laravel 7 project. The package works as expected, but I'm unable to use Tinkerwell on this project now. The regular php artisan tinker also works as normal. So I'm not sure is this is related to the medialibrary package, but this is the only package that makes Tinkerwell stop working.
syntax error, unexpected '$conversion' (T_VARIABLE), expecting ')'
at vendor/spatie/laravel-medialibrary/src/MediaCollections/Models/Media.php:174
170| public function getMediaConversionNames(): array
171| {
172| $conversions = ConversionCollection::createForMedia($this);
173|
> 174| return $conversions->map(fn (Conversion $conversion) => $conversion->getName())->toArray();
175| }
176|
177| public function hasGeneratedConversion(string $conversionName): bool
178| {
[2m+1 vendor frames [22m
2 [internal]:0
Composer\Autoload\ClassLoader::loadClass("Spatie\MediaLibrary\MediaCollections\Models\Media")
[2m+9 vendor frames [22m
12 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Spatie\MediaLibrary\MediaLibraryServiceProvider))
Not sure what I did really, but I had this error as well. I either updated Tinkerwell to 2.4.0 or cleared cache or something.
Interesting @bkintanar 馃
I've tried clearing the cache and updated to the latest Tinkerwell. The problem stays in this project with Media-library 8.
I've just upgraded to Tinkerwell 2.5. Still, the same errors.
Strangely all other projects (even with Media-library 7) work fine.
I'm thinking this error isn't related to this package. Judging by the error message you're using a wrong version of PHP.
You're absolutely right! Tinkerwell was pointed to a PHP version 7.3 bin on my machine.
I'm terribly sorry to have bothered you with this. It has nothing to do with this package.
No need to apologize! Glad you found the solution 馃憤
You're absolutely right! Tinkerwell was pointed to a PHP version 7.3 bin on my machine.
I'm terribly sorry to have bothered you with this. It has nothing to do with this package.
how you did fix it ?
@niypoo Tinkerwell was pointed to the wrong PHP version on my machine.
Settings > Advanced > PHP binary
I had the same problem, thanks for pointing to the solution
I had the same issue but resolved in php version 7.4
Most helpful comment
You're absolutely right! Tinkerwell was pointed to a PHP version 7.3 bin on my machine.
I'm terribly sorry to have bothered you with this. It has nothing to do with this package.