Every model extends Illuminate\Database\Eloquent\Model which has a trait Illuminate\Database\Eloquent\Concerns\HasRelationships which contains hasMany method.
Maybe using IDE like PhpStorm can help you get up to speed with Laravel and it's magic.
There are only few cases important in the beginning like in this case
- if you call
$model->tasks()you will be able to chain on method calls to specify more constraints on your query - if you call
$model->tasksyou will receive a collection of results for your query - if you have
scopeBest()method on your model you can call it like$model->best()
That will get you far from where you are now. When you get past that you can ask for more info on Laravel magic.