예제 #1
0
파일: api.php 프로젝트: letid/lethil
 public function classConcluded()
 {
     app\verso::nav()->request();
     app\verse::nav()->request();
     app\log::hits()->counter();
     app\avail::assist()->error_get_last();
     $this->timerfinish = $this->timer->finish();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, Application $application)
 {
     if ($request->hasFile('photo')) {
         \File::delete($application->photo);
         $file = $request->file('photo');
         $destination_path = 'uploads/';
         $filename = str_random(6) . '_' . $file->getClientOriginalName();
         $file->move($destination_path, $filename);
         $photo = $destination_path . $filename;
     } else {
         $photo = $application->photo;
     }
     if ($request->hasFile('application')) {
         \File::delete($application->application);
         $file = $request->file('application');
         $destination_path = 'uploads/';
         $filename = str_random(6) . '_' . $file->getClientOriginalName();
         $file->move($destination_path, $filename);
         $app = $destination_path . $filename;
     } else {
         $app = $application->application;
     }
     $application->update(['application' => $app, 'photo' => $photo, 'slug' => str_slug($request->input('name')), 'name' => $request->input('name'), 'version' => $request->input('version'), 'description' => $request->input('description'), 'email' => $request->input('email'), 'platform' => $request->input('platform')]);
     $this->syncCategory($application, $request->input('AppCategoryList'));
     $id = $application->id;
     Application::find($id)->logs()->save(log::create(['content' => '', 'user_id' => $request->input('user_id'), 'descriptions' => 'Kamu berhasil Update Aplikasi , Name :' . $request->input('name') . ', version: ' . $request->input('version') . ', platform :' . $request->input('platform')]));
     return redirect('user/' . \Auth::user()->name);
 }
예제 #3
0
 public static function addAddress($addressData)
 {
     log::info($addressData);
     $addressId = Address::create($addressData)->id;
     return $addressId;
 }