/** * Run the database seeds. * * @return void */ public function run() { $totalProd = \App\Models\Product::count(); for ($i = 1; $i <= $totalProd; $i++) { $from = $this->imageGeneratorUrl . '?random=' . $i; $to = public_path() . $this->destination . "/{$i}.jpg"; echo "Loading image {$i} \n"; copy($from, $to); } }
/** * Display a listing of the resource. * * @return Response */ public function index(Region $region, TrainRoad $trainRoad, Stantion $stantion) { $regionsCount = $region->count(); $tRoadsCount = $trainRoad->count(); $stationsCount = $stantion->count(); $condCount = Condition::count(); $productsCount = Product::count(); $servicesCount = Service::count(); $catCount = Category::count(); $statusesCount = Status::count(); $serviceStatusesCount = ServiceStatus::count(); $newOrdersCount = Order::where('is_new', 1)->count(); $newServiceOrdersCount = ServiceOrder::where('is_new', 1)->count(); $customers = Firm::where('accountant_fio', null)->get(); return view('admin.adminArea', ['regionsCount' => $regionsCount, 'tRoadsCount' => $tRoadsCount, 'stationsCount' => $stationsCount, 'condCount' => $condCount, 'catCount' => $catCount, 'productsCount' => $productsCount, 'servicesCount' => $servicesCount, 'statusesCount' => $statusesCount, 'newOrdersCount' => $newOrdersCount, 'serviceStatusesCount' => $serviceStatusesCount, 'newServiceOrdersCount' => $newServiceOrdersCount, 'customers' => $customers]); }
public static function GenerateFake($faker) { return ['pack_id' => $faker->numberBetween($min = 1, $max = Pack::count()), 'product_id' => $faker->numberBetween($min = 1, $max = Product::count())]; }