public function create($id) { $cliente = Client::with('info')->where('id', '=', $id)->first(); $company = Company::with('managers')->where('id', '=', \Auth::guard('web_managers')->user()->company_id)->firstOrFail(); $config = json_decode($company->configuracoes); $tiposEvento = ArrayObjToArray($config->config->tipoEvento); return view('admin.orcamento.create', compact('cliente', 'config', 'tiposEvento', 'company')); }
public function clientsForSelect() { $clientes = Client::all(); $result = array(); foreach ($clientes as $key => $value) { $result[$value->id] = $value->nome . ' - ' . $value->email; } return $result; }
public function run() { Client::create(['company_id' => '1', 'nome' => 'Igor Lucas', 'email' => '*****@*****.**', 'password' => '$2y$10$pypA.TS2dukCoFA9y01f5uQfE2YDVuflAiRh2VfGcoChKl5VemIli', 'user_type' => 'cliente', 'avatar' => '1.jpg', 'foto' => '1.jpg', 'remember_token' => 'k07njmWuZIvjg0cwSHwfIgDwIRlDsLlQeDJVMH96NRPQVj92OAJGhXiMt9SG', 'created_at' => '2015-09-14 00:23:25', 'updated_at' => '2015-09-14 00:23:25']); Infoextra::create(['company_id' => '1', 'client_id' => '1']); Client::create(['company_id' => '1', 'nome' => 'Igor Lucas', 'email' => '*****@*****.**', 'avatar' => '1.jpg', 'foto' => '1.jpg']); Infoextra::create(['company_id' => '1', 'client_id' => '2']); Client::create(['company_id' => '2', 'nome' => 'Erika Brum', 'email' => '*****@*****.**', 'avatar' => '2.jpg', 'foto' => '2.jpg']); Infoextra::create(['company_id' => '2', 'client_id' => '3']); }
public function updateFoto(Request $request, $id) { $cliente = Client::find($id); $foto = $this->repository->administraFotoPerfil($cliente, $request->file('foto')); if ($foto) { Flash::notify('Foto alterada com sucesso.', 'success', 2500); } return redirect()->back(); }