E
E
Emil Rakhmatullin2020-05-02 12:44:01
Laravel
Emil Rakhmatullin, 2020-05-02 12:44:01

Why are methods written WITH and WITHOUT parentheses in the blade template? What is the difference?

For example,
{{ Auth::user()->roles() }}
and
{{ Auth::user()->roles }}
can be performed in different ways. Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shelygin, 2020-05-02
@Emchik

->roles() returns a Builder
and ->roles a collection

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question