foreach($patterns as $p) {
$pat = Pattern::create(['title' => $p]);
$path = base_path() . '/storage/feed.img/' . $p . '.jpg';
if(file_exists($path)) {
$file = new System\Models\File;
$file->fromFile($path);
$pat->photos()->add($file);
}
}