You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have installed "maatwebsite/laravel-nova-excel": "^1.3" into Laravel 10 / php 8.2/ nova 4.27 app
and I added DownloadExcel method into actions methods of Users resource.
It works ok, but I also need to add more fields from related Profile table.
I found this #74
branch and created a class app/Library/DownloadUsersIntoExcel.php :
<?php
namespace App\Library;
use App\Models\User;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Http\Requests\ActionRequest;
use Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel;
class DownloadUsersIntoExcel extends DownloadExcel
{
/**
* @param ActionRequest $request
* @param Action $exportable
*
* @return array
*/
public function handle(ActionRequest $request, Action $exportable): array
{
$retArray = [];
$exportable->query = $this->customQuery($request);
\Log::info(varDump($exportable->query, ' -1 handle $exportable->query::'));
return $retArray;
}
private function customQuery($request)
{
\Log::info(' -1 customQuery $exportable->query::');
return User::all();
}
}
and use it in app/Nova/User.php class :
public function actions(NovaRequest $request)
{
return [
new DownloadUsersIntoExcel,
];
}
Runnin the action I see log lines in log file(methods handle and customQuery are called), but is not is_uploaded -
I have no download dialog under my Chrome...
How to fix it ?
The text was updated successfully, but these errors were encountered:
I have installed "maatwebsite/laravel-nova-excel": "^1.3" into Laravel 10 / php 8.2/ nova 4.27 app
and I added DownloadExcel method into actions methods of Users resource.
It works ok, but I also need to add more fields from related Profile table.
I found this
#74
branch and created a class app/Library/DownloadUsersIntoExcel.php :
and use it in app/Nova/User.php class :
Runnin the action I see log lines in log file(methods handle and customQuery are called), but is not is_uploaded -
I have no download dialog under my Chrome...
How to fix it ?
The text was updated successfully, but these errors were encountered: