Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HasStatuses.php #117

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update HasStatuses.php #117

wants to merge 1 commit into from

Conversation

ju-gow
Copy link

@ju-gow ju-gow commented Mar 12, 2024

Need to define a HasStatuses::__isset method in order to use with data_get() helper function

Example :

$model = new MyModel;
$model->setStatus( 'my-status' );

$status = data_get( $model, 'status' ); // 'my-status'

Usefull when using spatie/laravel-html, overwise current status value is not retrieved

{{ htm()->model( $model )->form('POST')->open() }}
    {{ html()->select( 'status', [ 'todo' => 'Need action', 'done' => 'Done' ] ) }}
{{ html()->form()->close() }}

Need to define a HasStatuses::__isset method in order to use with data_get() helper function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant