Object-oriented Principles — In Php Laracasts [new] Download

class Shape public function area() // Calculate area

Imagine a PaymentGateway interface. You might have Paypal , Stripe , and BankTransfer classes. They all have a pay() method, but the internal logic is totally different. object-oriented principles in php laracasts download

Laracasts frequently uses inheritance to avoid duplication. For instance, a Vehicle parent class and Car , Motorcycle children. class Shape public function area() // Calculate area

(e.g., a BankAccount class):

return $this->model->find($id);