You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
580 B
22 lines
580 B
<?php
|
|
|
|
namespace App\Utilities\Middlewares;
|
|
|
|
use Closure;
|
|
|
|
class BindBusinessInfo
|
|
{
|
|
|
|
public function handle($request, Closure $next, $guard = null)
|
|
{
|
|
$business_id = $request->has('business_id') ? $request->business_id : $request->route('business');
|
|
$businessInfo = env('CONTAINER_NAME') == 'hi-user-app' ?
|
|
\App\Business::info($business_id) :
|
|
get('user', env('USER_URL') . 'actions/businesses/' . $business_id . '/info', []);
|
|
|
|
|
|
$request->merge(['_business_info' => $businessInfo]);
|
|
|
|
return $next($request);
|
|
}
|
|
}
|