Is there any way in Laravel (5.2) to call static and non-static functions in a custom object without instantiating the referring object in all classes used?
Example: I have class App\Helpers\Utilities.php
with public function doBeforeTask()
I'm using this method in a lot of classes within my project, and it would be pretty if I could call Utilities::doBeforeTask()
or Utilities->doBeforeTask()
without creating an instance of my Utilities object $obj = new Utilities();
public static function doBeforeTask()
accomplish exactly what you need?