close #273 Fixed: Banking - Transfer and Transactions - Latest dates should be first then descend for consistency

This commit is contained in:
cuneytsenturk
2018-07-09 12:01:16 +03:00
parent bf30fad8af
commit eec7c0290b
6 changed files with 132 additions and 60 deletions

View File

@ -0,0 +1,36 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Date;
use Illuminate\Support\Facades\Request;
class TransferDateFormat
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$company_id = session('company_id');
if (empty($company_id)) {
return $next($request);
}
$method = Request::method();
if (($method == 'POST') || ($method == 'PATCH')) {
$time = Date::now()->format('H:i:s');
$request['transferred_at'] = $request['transferred_at'] . ' ' . $time;
}
return $next($request);
}
}