appstract / laravel-blade-directives

A collection of nice Laravel Blade directives
MIT License
860 stars 75 forks source link

@script is broken #57

Open sergejostir opened 4 years ago

sergejostir commented 4 years ago

Commit 16f90532caf9c953987d5e89f89ed338c57f8fec broke the @script directive.

@antoniancu, blade directives simply don't work like that.

    'script' => function ($expression) {
        if (! empty($expression)) {
            $expression = DirectivesRepository::parseMultipleArgs($expression);
            $defer = $expression->get(1) ? ' defer' : '';

            return '<script src="'.DirectivesRepository::stripQuotes($expression->get(0)).'"'.$defer.'></script>';
        }

        return '<script>';
    },

I'm surprised how nobody noticed that in nearly two months ...

gizburdt commented 4 years ago

Thanks! Do you want to create a revert that fixes this? :)

sergejostir commented 3 years ago

I don't use this package anymore, so I believe it's better that someone who uses this directive fixes it.