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.

19 lines
449 B

  1. <?php
  2. namespace App\Utilities\Middlewares;
  3. use Closure;
  4. use App\Models\Business;
  5. class BindBusinessInfo
  6. {
  7. public function handle($request, Closure $next, $guard = null)
  8. {
  9. $business_id = $request->has('business_id') ? $request->business_id : $request->route('business');
  10. $businessInfo = Business::info($business_id);
  11. $request->merge(['_business_info' => $businessInfo]);
  12. return $next($request);
  13. }
  14. }