<?php

namespace App\Http\Controllers\Admin\Base;

use Illuminate\Http\Request;
use App\Http\Controllers\Admin\Controller;

class LocationController extends Controller
{
    public function index(Request $request)
    {
        $location = $request->input('location');

        $items = explode(',', $location);
        if(count($items) < 2) {
            $lat = '39.91652';
            $lng = '116.397128';
        } else {
            $lat = $items[0];
            $lng = $items[1];
        }
        return view('admin.base.locations.index', compact('lat', 'lng', 'location'));
    }
}
