Skip to main content

Public Homepage and Restaurant Page

Premium
11 min read

Comments & Discussion

ZR
Zaryab Rizvi ✓ Link copied!

User::factory(50)->vendor()->has($restaurants)->create();

in this code where you define vendor ? when i am running the seedor getting error of this kindly guide me thanks,

Muhammad Zaryab

ZR
Zaryab Rizvi ✓ Link copied!

kindly add the state of vendor in userfactory.php

public function vendor(): static { return $this->afterCreating(function (User $user) { $vendorRole = Role::where('name', RoleName::VENDOR->value)->first(); $user->roles()->sync($vendorRole); }); }

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.