25 lines
496 B
PHP
25 lines
496 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Models\Models\Country;
|
|
use App\Models\Models\State;
|
|
|
|
class LocationController extends Controller
|
|
{
|
|
|
|
public function getCountries()
|
|
{
|
|
$countries = Country::select('id', 'name','phonecode')->get();
|
|
|
|
return response()->json([
|
|
'data' => $countries
|
|
]);
|
|
}
|
|
|
|
// public function getState($id){
|
|
// $state = State::with('getCountryName')->select('id','name')
|
|
// }
|
|
}
|