GlobalNames.php 716 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Http\Middleware;
  3. use App\Models\Configuration;
  4. use Closure;
  5. use Illuminate\Http\Request;
  6. class GlobalNames
  7. {
  8. /**
  9. * Handle an incoming request.
  10. *
  11. * @param Request $request
  12. * @param Closure $next
  13. * @return mixed
  14. */
  15. public function handle(Request $request, Closure $next)
  16. {
  17. define('CREDITS_DISPLAY_NAME' , Configuration::getValueByKey('CREDITS_DISPLAY_NAME' , 'Credits'));
  18. $unsupported_lang_array = explode(',', config("app.unsupported_locales"));
  19. $unsupported_lang_array = array_map( 'strtolower', $unsupported_lang_array );
  20. define('UNSUPPORTED_LANGS', $unsupported_lang_array);
  21. return $next($request);
  22. }
  23. }