1. Go to this page and download the library: Download kirilldakhniuk/dead-drop library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kirilldakhniuk / dead-drop example snippets
use KirillDakhniuk\DeadDrop\Facades\DeadDrop;
// Simple export
DeadDrop::export('users');
// With date range
DeadDrop::export('users', [
'where' => [
['created_at', '>=', '2024-01-01'],
['created_at', '<=', now()->toDateTimeString()]
]
]);
// Export all tables with date filter
DeadDrop::exportAll(null, null, [
'where' => [
['created_at', '>=', now()->subMonth()->toDateTimeString()],
]
]);
// Nova/Filament integration
public function handle()
{
$result = DeadDrop::export('users', [
'where' => [
['created_at', '>=', $this->startDate],
]
]);
return Action::download($result['file']);
}