This commit is contained in:
hackerESQ
2024-08-29 23:36:44 -05:00
parent 2febed20ae
commit df1071d628
13 changed files with 204 additions and 64 deletions
+5 -1
View File
@@ -9,6 +9,10 @@ use Maatwebsite\Excel\Concerns\WithTitle;
class PortfoliosSheet implements FromCollection, WithHeadings, WithTitle
{
public function __construct(
public bool $empty = false
) { }
public function headings(): array
{
return [
@@ -26,7 +30,7 @@ class PortfoliosSheet implements FromCollection, WithHeadings, WithTitle
*/
public function collection()
{
return Portfolio::myPortfolios()->get();
return $this->empty ? collect() : Portfolio::myPortfolios()->get();
}
/**