Update (all): fix php formatting using laravel pint, fix blade using shufo
This commit is contained in:
@@ -3,32 +3,27 @@
|
||||
namespace App\Http\Controllers\Front;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Stevebauman\Location\Facades\Location;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\CountryLocale;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
return redirect()->route('home.country', ['country' => 'my']);
|
||||
return redirect()->route('home.country', ['country' => 'my']);
|
||||
}
|
||||
|
||||
public function country(Request $request, $country)
|
||||
{
|
||||
$country = CountryLocale::where('slug', $country)->first();
|
||||
$country = CountryLocale::where('slug', $country)->first();
|
||||
|
||||
if (!is_null($country))
|
||||
{
|
||||
$categories = Category::where('country_locale_id', $country->id)->get();
|
||||
if (! is_null($country)) {
|
||||
$categories = Category::where('country_locale_id', $country->id)->get();
|
||||
|
||||
return view('front.country', ['categories' => $categories, 'country' => $country]);
|
||||
}
|
||||
return view('front.country', ['categories' => $categories, 'country' => $country]);
|
||||
}
|
||||
|
||||
return redirect()->route('home.country', ['country' => 'my']);
|
||||
return redirect()->route('home.country', ['country' => 'my']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user