0

I have imports:

namespace App\Http\Controllers;

use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithTitle;
use Maatwebsite\Excel\Facades\Excel;
use Exportable;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;

And class:

class ArchivingController extends Controller implements WithMultipleSheets
{

    use Exportable;

}

Why I get message:

Trait 'Exportable' not found

POV
  • 11,293
  • 34
  • 107
  • 201

1 Answers1

1

change the use Exportable; to

use Maatwebsite\Excel\Concerns\Exportable;

you need it to have an alias loaded in app.php in the aliases to use it as

use Exportable;
N69S
  • 16,110
  • 3
  • 22
  • 36
  • Thank you, now I get this message after your advice: `Class App\Http\Controllers\ArchivingController contains 1 abstract method and must ` – POV Jul 23 '19 at 11:06
  • Seems one method from WithMultipleSheets is necessery – POV Jul 23 '19 at 11:06
  • @OPV yes, one (or more) of the concern need a function declaration for it to not generate the error – N69S Jul 23 '19 at 11:11