updated some functions and got rid of a useless function
This commit is contained in:
@@ -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');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = [
|
||||||
|
|||||||
@@ -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();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user