Это моя директива Blade:
Код: Выделить всё
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Blade::directive('highlight', function($expression, $string){
$expressionValues = preg_split('/\s+/', $expression);
foreach ($expressionValues as $value) {
$string = str_replace($value, "".$value."[/b]", $string);
}
return "";
});
}
public function register()
{
}
}
Код: Выделить всё
@highlight('ho', 'house')
Код: Выделить всё
Missing argument 2 for App\Providers\AppServiceProvider::App\Providers\{closure}()
Подробнее здесь: https://stackoverflow.com/questions/410 ... -directive
Мобильная версия