can you also show AccountData file ?
Feb 8, 2020
6
Level 1
Undefined type 'App\AccountData
Hello everyone. I'm reading the documentation of Laravel Nova about the actions, at this adress : https://nova.laravel.com/docs/2.0/actions/defining-actions.html#action-fields
At this point, it's asked to use App\AccountData in the handle function of acton called ``` EmailAccountProfile.php. The path of the file is : app/Nova/Actions
But when I do it, I get a "Undefined type 'App\AccountData'" error.
My EmailAccountProfile.php file :
<?php
namespace App\Nova\Actions;
use App\AccountData;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Collection;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\ActionFields;
class EmailAccountProfile extends Action
{
use InteractsWithQueue, Queueable;
/**
* Perform the action on the given models.
*
* @param \Laravel\Nova\Fields\ActionFields $fields
* @param \Illuminate\Support\Collection $models
* @return mixed
*/
public function handle(ActionFields $fields, Collection $models)
{
foreach ($models as $model) {
(new AccountData($model))->send();
}
}
/**
* Get the fields available on the action.
*
* @return array
*/
public function fields()
{
return [];
}
}
Please or to participate in this conversation.