Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/Controller.php
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | class Controller extends BaseController | ||||
* Get the guard to be used during authentication. | * Get the guard to be used during authentication. | ||||
* | * | ||||
* @return \Illuminate\Contracts\Auth\Guard | * @return \Illuminate\Contracts\Auth\Guard | ||||
*/ | */ | ||||
protected function guard() | protected function guard() | ||||
{ | { | ||||
return Auth::guard(); | return Auth::guard(); | ||||
} | } | ||||
/** | |||||
* A wrapper for \trans() with theme localization support. | |||||
* | |||||
* @param string $label Localization label | |||||
* @param array $params Translation parameters | |||||
*/ | |||||
public static function trans(string $label, array $params = []): string | |||||
{ | |||||
$result = \trans("theme::{$label}", $params); | |||||
if ($result === "theme::{$label}") { | |||||
$result = \trans($label, $params); | |||||
} | |||||
return $result; | |||||
} | |||||
} | } |