可选的抽象方法

I currently have an abstract class which i am extending to other controllers. I have a abstract function within the abstract class which takes the value and places it in the __construct.

abstract class Controller extends BaseController {
    abstract public function something();

    public function __construct(Request $request) {
        if (!is_null($this->something())){
            $this->global_constructor_usse = $this->something();
        }
    }
}

My problem is that on controllers that dont require this abstract function, i am having to place in the empty function.

class ControllerExample extends Controller {
  public function something(){
      return 'somethinghere';
  }
}

Is there anyway to making the abstract function optional or have a default value?

class EmptyControllerExample extends Controller {
  public function something(){}
}

Or what would be the best method of going about this?

Abstract functions in a parent class, should only be used if its required by your application to implement the following method in all controllers who inherits from it, clearly it is not the case.

In this case i would make a trait. Here you create a trait which can be implemented by the classes who needs it. Notice the use keyword usage, use somethingTrait;

trait somethingTrait
{
    public function something()
    {
        echo "something called";
    }
}

class Controller
{
    use somethingTrait;

    public function run()
    {
        $this->something();
    }
}

phpfiddle link

Another aproach could be doing a class inheritance structure, if the controllers you want to implement the methods has something in common. Where you would implement your special method in CrmController, where you still would be able to create shared methods in the abstract controller.

                                 AbstractController
                                         |
                                    CrmController
                                         |
                                   CompanyController

For your question, 'Is there anyway to making the abstract function optional or have a default value?' No, and you are down the wrong path if you are trying to make abstract function optional. Hope my suggestions can help.

It is not possible to have a abstract method optional, as it is implied in PHP that all abstract methods must have an implementation.

There are legit use cases for optional abstract methods, yes: event handlers, metadata describers, etc. Unfortunately, you'll need to use regular, non-abstract methods with an empty body, and indicate in PHPDoc that they will do nothing unless extended.

Be wary, though: this can very quickly turn into code smell by diffusing a class responsability with their children. If you're dealing with generic events, you can look into Laravel's own event system, or the Observer pattern instead.