Eloquent Tinker - Undefined Constant
Asked Answered
W

1

6

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?

Wives answered 11/4, 2015 at 15:42 Comment(0)
M
18

You should use backslash \:

$article = new App\Article;
Misconstruction answered 11/4, 2015 at 15:48 Comment(1)
There should really be a faceplam tag that can be put on a question. Thanks for your help, gifsforum.com/images/gif/facepalm/grand/….Wives

© 2022 - 2024 — McMap. All rights reserved.