Blade Directive to show content on/after given date

Submitted by sarfraznawaz2005 - 2 weeks ago

Blade Directive to show content on/after given date

use Carbon\Carbon;
use Illuminate\Support\Facades\Blade;

Blade::if('dated', static function ($date) {
    return Carbon::now()->gte(Carbon::parse($date));
});

// USAGE

/*
@dated('11/27/2019')
    <div>This will only show on/after 11/27/2019</div>
@enddated
*/
Stats Categories Tags