php - Laravel Fzaninotto Faker Seed File: [ErrorException] copy(): The first argument to copy() function cannot be a directory -
i want create files seedfile using fzaninotto/faker.
file($sourcedir = '/tmp', $targetdir = '/tmp') // '/path/to/targetdir/13b73edae8443990be1aa8f1a483bc27.jpg' file($sourcedir, $targetdir, false) // '13b73edae8443990be1aa8f1a483bc27.jpg'
my seedfile files looks this:
$factory('app\file', [ 'order_id' => 'factory:app\order', 'originalfilename' => $faker->file(public_path('files/uploads'), public_path('files/uploads/tmp'), false), 'filename' => $faker->randomnumber($nbdigits = null), 'filepath' => 'files/uploads' ]);
and have public folder structure looks this:
public -files -uploads -tmp <- here dummy files of mine can used fzaninotto fakers dummy creation class
how structure seedfile correctly, able generate dummy files?
accidentally hat source directory target directory. works now:
$factory('app\file', [ 'order_id' => 'factory:app\order', 'originalfilename' => $faker->randomnumber($nbdigits = null), 'filename' => $faker->file(public_path('files/uploads/tmp'), public_path('files/uploads'), false), 'filepath' => 'files/uploads' ]);