Subscribed unsubscribe Subscribe Subscribe

hasen's tech life

Twitter: @hasen

Laravel v5.1で"Cannot redeclare class TwigBridge\Extension\Laravel\String"というエラーが出たので対応.

# Laravel v5.1でconfig:cacheをしたところ,
# "Cannot redeclare class TwigBridge\Extension\Laravel\String"というエラーが出たので対応.
# rcrowe/twigbridgeのヴァージョンを上げた.

$ php artisan --version
> Laravel Framework version 5.1.29 (LTS)

$ php artisan config:cache
> Configuration cache cleared!
>
> [ErrorException]
> Cannot redeclare class TwigBridge\Extension\Laravel\String
>

$ vi composer.json
-- "rcrowe/twigbridge": "0.8.2",
++ "rcrowe/twigbridge": "0.9.1",

$ composer update
$ php artisan config:cache
> Configuration cache cleared!
> Configuration cached successfully!