Skip to content

Response

  1. Prefer explicit response methods:

    php
     // Good
     return redirect()->route('home');
     return redirect()->to($url);
    
     // Bad (mixed return types)
     return redirect(route('home'));
     return redirect($url);
  2. Use consistent HTTP status codes. Limit the number of codes the app can return and process them consistently.