src/Http/Controllers/Adminarea/ServiceBookingsController.php
public function hoard(ImportFormRequest $request)
    {
        foreach ((array) $request->get('selected_ids') as $recordId) {
            $record = app('cortex.foundation.import_record')->find($recordId);

            try {
                $fillable = collect($record['data'])->intersectByKeys(array_flip(app('rinvex.bookings.service')->getFillable()))->toArray();

                tap(app('rinvex.bookings.service')->firstOrNew($fillable), function ($instance) use ($record) {
                    $instance->save() && $record->delete();
                });
            } catch (Exception $exception) {
                $record->notes = $exception->getMessage().(method_exists($exception, 'getMessageBag') ? "\n".json_encode($exception->getMessageBag())."\n\n" : '');
                $record->status = 'fail';
                $record->save();
            }
        }

        return intend([
            'back' => true,
            'with' => ['success' => trans('cortex/foundation::messages.import_complete')],
        ]);
    }
public function hoard(ImportFormRequest $request)
    {
        foreach ((array) $request->get('selected_ids') as $recordId) {
            $record = app('cortex.foundation.import_record')->find($recordId);

            try {
                $fillable = collect($record['data'])->intersectByKeys(array_flip(app('rinvex.bookings.service')->getFillable()))->toArray();

                tap(app('rinvex.bookings.service')->firstOrNew($fillable), function ($instance) use ($record) {
                    $instance->save() && $record->delete();
                });
            } catch (Exception $exception) {
                $record->notes = $exception->getMessage().(method_exists($exception, 'getMessageBag') ? "\n".json_encode($exception->getMessageBag())."\n\n" : '');
                $record->status = 'fail';
                $record->save();
            }
        }

        return intend([
            'back' => true,
            'with' => ['success' => trans('cortex/foundation::messages.import_complete')],
        ]);
    }
public function hoard ( ImportFormRequest $ request ) { foreach ( ( array ) $ request -> get ( 'selected_ids' ) as $ recordId ) { $ record = app ( 'cortex.foundation.import_record' ) -> find ( $ recordId ) ; try { $ fillable = collect ( $ record [ 'data' ] ) -> intersectByKeys ( array_flip ( app ( 'rinvex.bookings.service' ) -> getFillable ( ) ) ) -> toArray ( ) ; tap ( app ( 'rinvex.bookings.service' ) -> firstOrNew ( $ fillable ) , function ( $ instance ) use ( $ record ) { $ instance -> save ( ) && $ record -> delete ( ) ; } ) ; } catch ( Exception $ exception ) { $ record -> notes = $ exception -> getMessage ( ) . ( method_exists ( $ exception , 'getMessageBag' ) ? "\n" . json_encode ( $ exception -> getMessageBag ( ) ) . "\n\n" : '' ) ; $ record -> status = 'fail' ; $ record -> save ( ) ; } } return intend ( [ 'back' => true , 'with' => [ 'success' => trans ( 'cortex/foundation::messages.import_complete' ) ] , ] ) ; }
Hoard services.

@param \Cortex\Foundation\Http\Requests\ImportFormRequest $request

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
Hoard services .