updated some functions and got rid of a useless function

This commit is contained in:
2019-02-23 23:30:08 -06:00
parent 84f4716d75
commit 6d239ab7ce
4 changed files with 1 additions and 29 deletions

View File

@@ -79,7 +79,6 @@ class MoonsAdminController extends Controller
])->update([ ])->update([
'RentalCorp' => $request->renter, 'RentalCorp' => $request->renter,
'RentalEnd' => $date, 'RentalEnd' => $date,
'Contact' => $contact,
]); ]);
//Going to store moon price in a table for future reference //Going to store moon price in a table for future reference
@@ -112,31 +111,6 @@ class MoonsAdminController extends Controller
return redirect('/moons/admin/updatemoon')->with('success', 'Moon Updated'); return redirect('/moons/admin/updatemoon')->with('success', 'Moon Updated');
} }
public function storeUpdateMoon2(Request $request) {
$this->validate($request, [
'system' => 'required',
'planet' => 'required',
'moon' => 'required',
'renter' => 'required',
'date' => 'required',
'contact' => 'required',
]);
$date = new Carbon($request->date . '00:00:01');
//Update the database entry
Moon::where([
'System' => $request->system,
'Planet' => $request->planet,
'Moon' => $request->moon,
])->update([
'RentalCorp' => $request->renter,
'RentalEnd' => $date,
'Contact' => $request->contact,
]);
return redirect('/moons/display')->with('success', 'Moon Updated');
}
public function addMoon() { public function addMoon() {
return view('moons/admin/addmoon'); return view('moons/admin/addmoon');
} }

View File

@@ -13,7 +13,7 @@ class MoonRent extends Model
public $primaryKey = 'id'; public $primaryKey = 'id';
//Timestamps //Timestamps
public $timestamps = true; public $timestamps = false;
//Fillable Items //Fillable Items
protected $fillable = [ protected $fillable = [

View File

@@ -31,7 +31,6 @@ class CreateMoonsTable extends Migration
$table->integer('FourthQuantity')->default('0'); $table->integer('FourthQuantity')->default('0');
$table->string('RentalCorp')->default('Not Rented'); $table->string('RentalCorp')->default('Not Rented');
$table->integer('RentalEnd')->default('0'); $table->integer('RentalEnd')->default('0');
$table->timestamp('created_at')->nullable();
}); });
} }
} }

View File

@@ -23,7 +23,6 @@ class CreateMoonRentsTable extends Migration
$table->string('Contact'); $table->string('Contact');
$table->string('Price'); $table->string('Price');
$table->string('Type'); $table->string('Type');
$table->timestamps();
}); });
} }