Answer the question
In order to leave comments, you need to log in
Blade and error?
I'm trying to create my own directive, but PHP decided to give me THIS error. How to fix it?
/app/Providers/AppServiceProvider.php :
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Blade;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Blade::component('particlas.modal', 'modal');
view()->composer('particlas.modal', function ($view) {
$view->with('test', 'test');
});
Blade::directive('ifTest', function () {
return "<?php if(!1>2): ?>";
});
}
}
Answer the question
In order to leave comments, you need to log in
<?php if(!1>2): ?>
if(1=2) {
without a closing bracket.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question