update marketing
All checks were successful
All checks were successful
This commit is contained in:
26
Modules/MarketingAddon/App/Exports/SmsGatewayExport.php
Normal file
26
Modules/MarketingAddon/App/Exports/SmsGatewayExport.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MarketingAddon\App\Exports;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
use Modules\MarketingAddon\App\Models\Smsgateway;
|
||||
|
||||
class SmsGatewayExport implements FromView
|
||||
{
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
$gateways = Smsgateway::with('type:id,name')
|
||||
->where('business_id', auth()->user()->business_id)
|
||||
->when(request('channel'), function ($q) {
|
||||
$q->where('channel', request('channel'));
|
||||
})
|
||||
->latest()
|
||||
->get();
|
||||
|
||||
return view('marketingaddon::sms-gateways.excel-csv', [
|
||||
'gateways' => $gateways
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user