简体   繁体   中英

Eloquent Tinker - Undefined Constant

I'm following along with this set of tutorials on laravel (They're excellent), and I keep running into this error:

PHP error:  Use of undefined constant Article

whenever I enter this line of code:

$article = new App/Article;

I've followed everything to the letter, and used the command:

$ php artisan make:model Article
Model created successfully.
Created Migration: 2015_04_11_152306_create_ar

What I find unusual is that in the tutorial, no migration was created when this command was called. Anyways, I'm trying to enter some data into my sqlite database through tinker, but I'm unable to create an Article object, and therefore cannot insert into the database. How would I got about either solving or bypassing this issue?

你应该使用反斜杠\\

$article = new App\Article;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM