Home>

Learning web service development tutorials with larvel.

<? php
namespace App \ Http \ Controllers;
use Illuminate \ Http \ Request;
use App \ Folder;
use App \ Task;
class TaskController extends Controller
{
    //
    public function index (int $id) {
        $folders = Folder :: all ();
        $current_folder = Folder :: find ($id);
        $tasks = Task :: where ('folder_id', $current_folder->id)->get ();
        return view ('tasks/index', [
            'folders' =>$folders,
            'current_folder_id' =>$id,
            'tasks' =>$tasks,
        ]);
    }
}

There is no error in the above code where Folder :: all ();is used.
An error will occur in Folder :: find () and Task :: where ().

vscode has
Undefined symbol 'find'.
Undefined symbol 'where'.
It has come out.

Why can I use all () and find () or where () gives an error?