I was just curious about Facade and service container binding functions in Laravel 5.1, let's say Reponse::json()
and response()->json()
are the same. But is there any reason that one of them is better than the other?
Asked
Active
Viewed 79 times
1

DucCuong
- 638
- 1
- 7
- 26
1 Answers
0
It is already stated on the Laravel's documentation
Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.
And this article by the creator of Laravel will also help you.

niko
- 99
- 2
-
This doesn't answer the question as posed by @DucCuong – Martijn Oct 11 '21 at 12:08