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?
-
Answer # 1
Related articles
- [php/xampp] an error occurs when setting the include path
- php - an error occurs when connecting to git on heroku
- php - on the lollipop server, 500 server error occurs except for the top page
- an error occurs when calling a function in a php external file from html
- php - error that occurs when laravel follow function undefined variable: user
- php - i don't know where to write pdoexception in the mvc model
- an error occurs in unit tests with phpunit
- ios - no numbers are displayed and an error occurs
- how to transition to a specific page when a 404 error occurs in window iis
- php - [wp] an error is displayed in the item part added to the user information in advanced custom field
- i don't know where the folder is in the book php that starts suddenly
- php - 404 not found nginx/1135 error resolution
- php - vlaravel form request does not show error statement
- linux - error occurs when firewall is stopped
- ruby - i get an error with a single test code for a model
- when i upgraded the php spreadsheet, i got an error
- php - ec-cube 405 error in self-made command (cron) in prod environment
- [php/mysql] sql syntax error of sqlstate [42000] occurs
- vim - error occurs in tarexe
- php: there is an error in the insert into line and it cannot be resolved
Related questions
- php : About the error when executing COM ("Excel.Application")
- [php] i can't build a test environment with xampp + phpunit + vs code
- php - e-mail transmission with laravel is garbled
- after upgrading the php version of the rental server from 58 to 74, composer stopped working on ssh connections
- php - i can't connect to mysql in laravel js
- php - i built an environment with docker and laravel, but i get a 404 file not found
- php - about searching with laravel where clause
- php - left join doesn't do what i want
- i want to display the selected radio button on the laravel php edit screen
- laravel code becomes undefined type in php intelephense (vscode)
It was a problem with vscode.
There seems to be a bug in the latest version of PHP Intelephense.
When I changed to the previous version, it became normal.