<?php
$output[] = `php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"`;
$output[] = `php -r "if (hash_file('SHA384', 'composer-setup.php') === 'bf16ac69bd8b807bc6e4499b28968ee87456e29a3894767b60c2d4dafa3d10d045ffef2aeb2e78827fa5f024fbe93ca2') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"`;
$output[] = `php composer-setup.php`;
$output[] = `php -r "unlink('composer-setup.php');"`;
foreach ($output as $o) {
echo $o;
}
use Session;
public function registrationTokenSave( Request $request , $token ){
$oEntryUser = $this->checkToken( $token );
$validator = Validator::make( $request->all() , $this->rules );
if ( $validator->fails() ){
Session::flash('errors', $validator->errors()); // Разовый показ сообщения.
return redirect()->back()
->withInput()
->withErrors($validator->errors());
}
return view('test');
}
@if (session('errors'))
@foreach(session('errors') as $err)
<div class="alert alert-danger alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<strong>{{ $err }}</strong>
</div>
@endforeach
@endif
@if (count($errors) > 0)
@foreach($errors->all() as $error)
<div class="alert alert-danger alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<strong>{{ $error }}</strong>
</div>
@endforeach
@endif
<?php namespace Mcamara\LaravelLocalization\Middleware;
use Illuminate\Http\RedirectResponse;
use Closure;
use Cookie;
class LocaleCookieRedirect {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle( $request, Closure $next )
{
$params = explode('/', $request->path());
$locale = $request->cookie('locale', false);
if (count($params) > 0 && app('laravellocalization')->checkLocaleInSupportedLocales($params[0])){
Cookie::forever('locale', $params[0]);
return $next($request);
}
if ( $locale && !(app('laravellocalization')->getDefaultLocale() === $locale && app('laravellocalization')->hideDefaultLocaleInURL())) {
app('session')->reflash();
$redirection = app('laravellocalization')->getLocalizedURL($locale);
return new RedirectResponse($redirection, 302, [ 'Vary' => 'Accept-Language' ]);
}
return $next($request);
}
}
public function setLocale($lang)
{
$locale = ($lang == 'hebrew') ? 'he' : 'ru';
$supported = LaravelLocalization::getSupportedLocales();
if (array_key_exists($locale, $supported)) {
LaravelLocalization::setLocale($locale);
$cookie = Cookie::forever('locale', $locale);
}
return redirect()->to(LaravelLocalization::getNonLocalizedURL(url()->previous()))->withCookie($cookie);
}