Level 75
I don't know about all that, but I know this works for an upload:
public function add(Request $request)
{
if (isset($_POST['submit'])) {
//echo "made it here";
$lid = DB::table('dc_dogs')->count();
$lid = $lid + 1;
$file = $request->file('ufile');
$file_name = $file->getClientOriginalName();
$file_ext = $file->getClientOriginalExtension();
$fileInfo = pathinfo($file_name);
$filename = $fileInfo['filename'];
$newname = $filename . $lid . "." . $file_ext;
$destinationPath = ASSET . 'upload/imgdogs';
echo $destinationPath;
$file->move($destinationPath, $newname);
$dogpic = Cln::fixValue($newname);
$dogname = ucfirst(Cln::fixValue($_POST['dogname']));
$sex = ucfirst($_POST['sex']);
$comments = Cln::fixValue($_POST['comments']);
$adopted = (isset($_POST['adopted']) == '1' ? '1' : '0'); ///added
$lastedit = date("Y-m-d H:i:s");
//echo "adpt=" . $adopted . "aaa";
if (!isset($error)) {
$postdata = array(
'dogpic' => $dogpic,
'dogname' => $dogname,
'sex' => $sex,
'comments' => $comments,
'adopted' => $adopted,
'lastedit' => $lastedit
);
DB::table('dc_dogs')->insert($postdata);
}
}
$title = 'Dog add';
$view = 'dog/add';
$layout = ViewLayout::getLayout('admin/addtp');
$content = View::make($view);
return view($layout)->with('content', $content)->with('title', $title);
}