ideas icon indicating copy to clipboard operation
ideas copied to clipboard

how to check @stack(variable) is isset or not in laravel blade (Feature Request)

Open sanmitpawar opened this issue 3 years ago • 1 comments

we are having @push('variable')
contents @endpush

and will call the same using

@stack('variable')

how to check that stack is isset or not and if not isset allow pushing some content like @yield

sanmitpawar avatar Mar 24 '21 04:03 sanmitpawar

Hi there, sorry if I misunderstand what you are asking. Are you asking to push the content only if it doesn't already exist? Would @once do what you are looking for? https://laravel.com/docs/master/blade#the-once-directive

jelib3an avatar May 24 '21 00:05 jelib3an