Eloquent provides almost all methods as static
methods. I need to add my custom methods in model. I wonder should I declare my functions static? What's best in terms of implementation and performance?
You should use static
for functions that'll logically be called statically. Read the docs for details on the difference.
Model::find()
is static because you don't have an instance of the model yet.
$model->delete()
is not static because it works on an existing instance of the model.