-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bc6572
commit 6a8fb39
Showing
5 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace App\Exports\Logs; | ||
|
||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; | ||
use Maatwebsite\Excel\Concerns\ShouldAutoSize; | ||
use Maatwebsite\Excel\Concerns\WithStyles; | ||
use Maatwebsite\Excel\Concerns\WithHeadings; | ||
use Maatwebsite\Excel\Concerns\FromCollection; | ||
|
||
class LogExport implements FromCollection, ShouldAutoSize, WithStyles, WithHeadings | ||
{ | ||
/** | ||
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $sheet | ||
* @return array | ||
*/ | ||
public function styles(Worksheet $sheet) | ||
{ | ||
return [ | ||
|
||
1 => [ "font" => [ "bold" => true, ], ], | ||
]; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function headings(): array | ||
{ | ||
return [ | ||
|
||
"ID", | ||
"Causer Type", | ||
"Causer ID", | ||
"Subject Type", | ||
"Subject ID", | ||
"Log Name", | ||
"Properties", | ||
"Event", | ||
"Created At", | ||
"Updated At", | ||
]; | ||
} | ||
|
||
/** | ||
* @return \Illuminate\Database\Eloquent\Collection | ||
*/ | ||
public function collection() | ||
{ | ||
return \Spatie\Activitylog\ActivitylogServiceProvider::getActivityModelInstance()->all([ | ||
|
||
"id", | ||
"causer_type", | ||
"causer_id", | ||
"subject_type", | ||
"subject_id", | ||
"log_name", | ||
"properties", | ||
"event", | ||
"created_at", | ||
"updated_at", | ||
]); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters