<?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(
                '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 [
            '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'
        ];
    }
}
