for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use App\Comment;
use App\User;
use App\Video;
use Illuminate\Database\Seeder;
class CommentsTableSeeder extends Seeder
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
$video = Video::find(1);
for ($i = 1; $i <= 3; $i++) {
$data = [
'user_id' => User::find($i)->id,
'video_id' => $video->id,
'comment' => 'Lorem ipsum comment',
];
Comment::create($data);
}
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.