Hi I am new to creating factories on Laravel and I am setting up a blog website. I had this going just fine and now it isn't working anymore.
When I use "tinker" to add fake data using (App/Models/Post::factory(30)->create();
), below error keep occurs. Could anyone please educate me why this error occurs?
App/Models/Post::factory(30)->create();
PHP Warning: Use of undefined constant App - assumed 'App' (this will throw an Error in a future version of PHP) in F:\coding\laravel\test-laraveleval()'d code on line 1
PHP Warning: Use of undefined constant Models - assumed 'Models' (this will throw an Error in a future version of PHP) in F:\coding\laravel\test-laraveleval()'d code on line 1
PHP Warning: A non-numeric value encountered in F:\coding\laravel\test-laraveleval()'d code on line 1
PHP Warning: A non-numeric value encountered in F:\coding\laravel\test-laraveleval()'d code on line 1
PHP Warning: Division by zero in F:\coding\laravel\test-laraveleval()'d code on line 1
[!] Aliasing 'Post' to 'App\Models\Post' for this Tinker session.
Illuminate\Database\QueryException with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'sint' for key 'categories_name_unique' (SQL: insert into categories (name, slug, updated_at, created_at) values (sint, ut-quisquam-et-et-tenetur-molestias-in-dolor-voluptatum, 2022-03-16 07:11:05, 2022-03-16 07:11:05))
'