Laravel School shows you how to implement the Open Closed Principle in Laravel for Sign up a user.

laravel principle