forum icon indicating copy to clipboard operation
forum copied to clipboard

where in documentation?

Open henricoo opened this issue 7 years ago • 4 comments

Hi all,

I swear i'm not just being lazy, but can anybody point out to my where in documentation can i look up for methods, and get a description as to what they do and to which class/object do they belong? i didn't find the laravel documentation very intuitive.

Thamk you all

henricoo avatar Nov 18 '17 20:11 henricoo

There are 3 "official" locals to see:

Maybe there is something unofficial, but I don't know... I would love to see other places with lists of methods and what they do! It would be faster to check than the current docs and more informative than the API docs. Because of this I told once that CodeIgniter has better docs, but Laravel docs are not bad, just a bit... sparse?

Anyway, you can speak Portuguese too, if you want ^^

ezaca avatar Nov 20 '17 01:11 ezaca

thank you for the reply, it seems to me this forum is international therefore writing in a language other than English may not be appropriate right? As i have your atention i would like to ask you a further question:

return redirect()->action('outroController@retorna')->with(['key'=>$value]);

it is like with() method works for view() but not for action() which i think it's a break of pattern from laravel i mean if the with() method carries variable from one environment to another that would be intintuitive if this same pattern followed through right?

henricoo avatar Nov 20 '17 12:11 henricoo

No, I think you have got it wrong...

redirect(...) helper will return a RedirectResponse instance, just for redirects. You can at most return some error trough the method ->withErrors(...associative array...). See this example in Validation docs.

view(...) helper, in the other hand, will return a View to print a Blade view. The view has the method ->with because you can pass parameters to render the view. It does not make sense to have the same method in the redirect, as it is not returning a view, but an HTTP 3xx response.

Anyway, if you have more questions about this specific topic (redirect/view), I recommend you to open a new Issue to not mix the subjects. You can/should reference this Issue #150 on it (just write the number with the # symbol normally to make a link).

Hope it helps!

ezaca avatar Nov 20 '17 17:11 ezaca

ok thanx one more time, anyway sometimes you need to redirect to some other route or a controller and i believe having one method name to passa variables in every case would be a good way to standardize, in the redirect case the with() shouldn't have to return anything jus passa the variable get it?

anyway i'm new in laravel, though picking some petty details i'm enjoying it

henricoo avatar Nov 21 '17 01:11 henricoo