public function postPrintdefault() { $in = Input::get(); $_id = Auth::user()->id; $def = Printdefault::where('ownerId', $_id)->first(); if ($def) { } else { $def = new Printdefault(); $def['ownerId'] = Auth::user()->id; } foreach ($in as $k => $v) { $def[$k] = $v; } $def->save(); return Response::json(array('result' => 'OK')); }
public static function getPrintDefault($type = 'asset') { $printdef = Printdefault::where('ownerId', Auth::user()->_id)->where('type', $type)->first(); if ($printdef) { return $printdef; } else { $d = new stdClass(); $d->col = 2; $d->res = 150; $d->cell_width = 250; $d->cell_height = 300; $d->margin_right = 8; $d->margin_bottom = 10; $d->font_size = 8; $d->code_type = 'qr'; return $d; } }