Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 232
mattegener Avatar asked Apr 11 '15 15:04

mattegener


1 Answers

You should use backslash \:

$article = new App\Article;
like image 94
Pantelis Peslis Avatar answered Sep 20 '22 02:09

Pantelis Peslis