Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Fabio_Umpierre's avatar

create props for table without model

Good morning, how are you guys?

I need to create a props like this: @props(['notice'=>new \Modules\Core\Models\Notice()])

but for notification, it just doesn't have a model...

Then I need to pass it in the same view like this:

This way it almost works:

@props(['notification' => (object) ['notifiable_type' => '', 'data' => '', 'created_at' => ' ']])

with the exception of created_at, which asks for a date

0 likes
1 reply
vincent15000's avatar

By definition, a props is a value passed from the parent component to the child component.

It has no sense to create a props.

This @props(['notice'=>new \Modules\Core\Models\Notice()]) can eventually be a default value if the no notice variable is passed to the child component.

Please or to participate in this conversation.