When discussing OOP, we must touch the "visibility" topic, meaning the public/private/protected keywords before properties/methods. When to use which?
For example, when creating methods in Controllers, we're probably used to "blindly" type public function ...
:
EveryControllerEver.php
public function index(){ // ...} public function create(){ // ...}
Question: in what cases would we change the methods to private
or protected
?
First, let me tell you...