RobinRadic / blade-extensions

Laravel Blade extensions like $loop->odd/$loop->index in foreach, view blocks and partials, etc
http://robin.radic.nl/blade-extensions
MIT License
267 stars 35 forks source link

BLADE-68 ⁃ not working on Laravel 5.4 even when using dev-develop branch #65

Closed vesper8 closed 7 years ago

vesper8 commented 7 years ago

Hi there,

I hadn't used your package for a while and tried to use it just now. I quickly saw that there was a conflict between the new $loop changes introduced in 5.3. So I came here to see if you had made any changes and saw you were working on a new 7.0 version that would fix all this!

So I switched to the develop branch and tried adding "radic/blade-extensions": "~7.0" but that didn't work. Then I changed that to dev-develop and that worked.

I got the latest files, cleared all cache and tried again but it's still giving me an error about Undefined index: iteration when trying to use $loop->iteration inside a @foreach loop

I published your blade-extensions config file and added a section for 5.4, basically just duplicated the 5.3 under version_overrides but that still didn't work. I thought maybe you're not merging the config so I also modified the blade-extensions.php file inside the vendor folder.. but still no go.

Can you tell me what I need to do to use your extension with 5.4 if I'm using your latest development branch?

Much appreciated!

Thanks!

RobinRadic commented 7 years ago

Sorry for the late response. This might do the trick:

config file blade-extensions.php


return [
    'mode'              => 'auto',
    'directives'        => [
    ],
    'version_overrides' => [
        // add 5.4
        '5.4' => [
            'foreach'    => null,
            'endforeach' => null,
            'break'      => null,
            'continue'   => null,
        ],
    ],
];

this will disable blade-extensions from overriding those directives

RobinRadic commented 7 years ago

I'll try to make time to finish 7.0 soon. most of it is already in place. just need to get it (successfully) tested on all laravel platforms automaticaly..

RobinRadic commented 7 years ago

@vesper8 commit and travis test results This should be working. Will tag 7.0.0 after some more adjustments / tests.

"radic/blade-extensions": "dev-develop as 7.0.0"