58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Exports;
|
|
|
|
use App\Models\ManageRestaurant;
|
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
|
|
|
|
class RestaurantExport implements FromCollection, WithHeadings
|
|
{
|
|
/**
|
|
* @return \Illuminate\Support\Collection
|
|
*/
|
|
public function collection()
|
|
{
|
|
return ManageRestaurant::select(
|
|
'id',
|
|
'name',
|
|
// 'description',
|
|
'phone_number',
|
|
'restaurant_id',
|
|
'address',
|
|
'bio',
|
|
'try_on_1',
|
|
'try_on_2',
|
|
'try_on_3',
|
|
'try_on_4',
|
|
'exclusion',
|
|
'latitude',
|
|
'longtitude',
|
|
'is_active'
|
|
)->get();
|
|
}
|
|
|
|
//function header in excel
|
|
public function headings(): array
|
|
{
|
|
return [
|
|
'Id',
|
|
'Restaurant Name',
|
|
// 'Description',
|
|
'Phone Number',
|
|
'Restaurant Id',
|
|
'Address',
|
|
'Bio',
|
|
'Try on 1',
|
|
'Try on 2',
|
|
'Try on 3',
|
|
'Try on 4',
|
|
'Exclusion',
|
|
'Latitude',
|
|
'Longitude',
|
|
'Active staus'
|
|
];
|
|
}
|
|
}
|