/** * @param $file * @return array */ public function uploadScreenShot3($file) { $name = Str::random() . '.' . strtolower($file->ext); $image = new Image($file->image); $image->saveAs(PATH_PUBLIC . '/images/' . $name, 100); return array('UploadScreenShot3Result' => $image->getUrl()); }
public function testRandom() { is(10, strlen(Str::random())); is(10, strlen(Str::random(10))); is(10, strlen(Str::random(10, true))); is(10, strlen(Str::random(10, false))); isNotSame(Str::random(), Str::random()); isNotSame(Str::random(), Str::random()); isNotSame(Str::random(), Str::random()); }