<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Mail;

class ParkingSearchController extends Controller
{
    // 初期表示
    public function index()
    {
        // 駐輪場情報検索
        $result = \DB::table('park as p')
            ->select('p.park_name', 'c.city_name', 's.station_neighbor_station')
            ->leftJoin('city as c', 'p.city_id', '=', 'c.city_id')
            ->leftJoin('station as s', 'p.park_id', '=', 's.park_id')
            ->orderBy('p.park_ruby')
            ->get();

        // 検索結果返却
        return view('general.swo5_1',['form_data' => $result ]);
    }
}