public function testCompanyName() { $this->assertEquals('AbuseIO', Brand::find(1)->company_name); $exitCode = Artisan::call('brand:edit', ['id' => '1', '--company_name' => 'New name 1']); $this->assertEquals($exitCode, 0); $this->assertContains('The brand has been updated', Artisan::output()); $brand = Brand::find(1); $this->assertEquals('New name 1', $brand->company_name); $brand->company_name = 'AbuseIO'; $brand->save(); }
/** * return the logo as an image * * @param int $id * @return \Illuminate\Http\Response */ public function logo($id) { $brand = Brand::find($id); // if the brand with the specified id doesn't exist return nothing if (!$brand) { return; } // get the mime type $finfo = new \finfo(FILEINFO_MIME_TYPE); $mimetype = $finfo->buffer($brand->logo); return response($brand->logo)->header('Content-Type', $mimetype); }
/** * {@inheritdoc}. */ protected function handleOptions($model) { $this->updateFieldWithOption($model, 'name'); if ($this->option('brand_id')) { if (null === Brand::find($this->option('brand_id'))) { $this->error('Unable to find brand with this criteria'); return false; } } $this->setSystemAccount($model); $this->updateFieldWithOption($model, 'brand_id'); $this->updateBooleanFieldWithOption($model, 'disabled'); return true; }
protected function getObjectByArguments() { return Brand::find($this->argument("id")); }
/** * Display the specified resource. * * @param Account $account * * @return \Illuminate\Http\Response */ public function show(Account $account) { $brand = Brand::find($account->brand_id); return view('accounts.show')->with('account', $account)->with('brand', $brand)->with('auth_user', $this->auth_user); }
/** * {@inheritdoc}. */ protected function getModelFromRequest() { return Brand::find($this->argument('id')); }