app/Http/Controllers/Api/AccountController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index($customerId)
    {
        $accounts = [];
        if($customerId){
            $accounts = Account::getAccountByCustomerId($customerId);
        };
        return response()->json($accounts);
    }
public function index ( $ customerId ) { $ accounts = [ ] ; if ( $ customerId ) { $ accounts = Account :: getAccountByCustomerId ( $ customerId ) ; } ; return response ( ) -> json ( $ accounts ) ; }
Display a listing of the resource.
Display a listing of the resource .