How business logic is handled within an application and where to place the logic will depend on the type of business logic . The decision on where to place the code which enforces the Business Rule will be determined by the guiding principle of Separation of Concerns and the desire to make Classes which are [...]
Category: Adding Business Logic
This section describes how to add simple business logic and validation to your application
Using PHP Traits to access Eloquent Events
Object Oriented programming languages, barring one or two exceptions, do not generally allow multiple inheritance. That is to say, if a class is inheriting from another class, it can't then also inherit from a third class or any subsquent classes. In cases where objects need to use methods contained in classes that they are not [...]
Adding an AJAX Live Search Function - Part 1 - Adding a Search Form
This post describes how to dynamically search for members of the tennis club by typing a member's name into the search box. On each keyup event the search will be refined to match any members whose name approximates the value typed into the search field. AJAX stands for Asynchronous Javascript And XML. This is a [...]
Adding an AJAX Live Search Function - Part 2 - Adding the Controller Search Function
Next we will add a route member.search and a matching controller function. This function will retrieve the character/characters typed by the user into the search box on the form. Using this value it will search the existing Members using Eloquent and trying to match what was typed with a either a member's firstname or surname. [...]