Open andreich1980 opened 7 years ago
Let's say I create a thread.
Method ThreadsController@store puts message in a session 'flash', 'Your thread has been published!'
ThreadsController@store
'flash', 'Your thread has been published!'
In the main layout we have code
<flash message="{{ session('flash') }}"></flash>
In the Flash component there's a created method that checks if message is presented then calls flash method with the message it has got.
Flash
created
message
flash
flash(data) { this.body = data.message; this.level = data.level; //... },
But flash method accepts only one argument and assumes that it's an object with message and level properties.
level
I think it's time to add level prop to the Flash component and change created method that it would call flash with an object it expects.
I could make a PR if I'm right.
Let's say I create a thread.
Method
ThreadsController@store
puts message in a session'flash', 'Your thread has been published!'
In the main layout we have code
In the
Flash
component there's acreated
method that checks ifmessage
is presented then callsflash
method with the message it has got.But
flash
method accepts only one argument and assumes that it's an object withmessage
andlevel
properties.I think it's time to add
level
prop to theFlash
component and changecreated
method that it would callflash
with an object it expects.I could make a PR if I'm right.