Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel factory pass parameter

//In your case you don't even need to access those attributes, since they'll automatically be merged in:

$business = factory(AppBusiness::class)->create();

factory(AppUser::class, 5)->create([
    'business_id' => $business->id,
]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #factory #pass #parameter
ADD COMMENT
Topic
Name
5+8 =