laravel / nova-issues

554 stars 34 forks source link

Action Log Error: Class name must be a valid object or string #949

Closed StanBarrows closed 5 years ago

StanBarrows commented 6 years ago

Description:

Following the Nova Doc: https://nova.laravel.com/docs/1.0/actions/defining-actions.html#action-log

Steps To Reproduce:

User-Model:

use App\App\Traits\HasUuid;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Nova\Actions\Actionable;

class User extends Authenticatable
{
    use Actionable, Notifiable, SoftDeletes, HasUuid;

}

User Actions:

image

Run an Action:

image

Action:

public function handle(ActionFields $fields, Collection $models)
    {
        try {
            foreach ($models as $model) {
                $model->notify(new SendPlatformInvitationNotification($model));
            }

            return Action::message('It worked!');
        } catch (\Exception $exception) {
            // @Todo Log

            return Action::danger('Something went wrong!');
        }
    }
image

Errors:

image image
Quinndark commented 5 years ago

I have met the same question.

davidhemphill commented 5 years ago

Sorry, but we are unable to debug your issue without a reproducible code example. Once you provide that we can open this up again.

phuclh commented 5 years ago

I have the same issue.