changed models
This commit is contained in:
@@ -6,7 +6,7 @@ use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use Socialite;
|
||||
use Auth;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
|
||||
use Seat\Eseye\Cache\NullCache;
|
||||
use Seat\Eseye\Configuration;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Moon;
|
||||
use App\Models\Moon;
|
||||
use Seat\Eseye\Cache\NullCache;
|
||||
use Seat\Eseye\Configuration;
|
||||
use Seat\Eseye\Containers\EsiAuthentication;
|
||||
use Seat\Eseye\Eseye;
|
||||
use DB;
|
||||
use App\Library\MoonCalc;
|
||||
|
||||
class MoonsController extends Controller
|
||||
@@ -73,6 +73,8 @@ class MoonsController extends Controller
|
||||
$moon = new Moon;
|
||||
$moon->Region = $request->input('region');
|
||||
$moon->System = $request->input('system');
|
||||
$moon->Planet = $request->input('planet');
|
||||
$moon->Moon = $request->input('moon');
|
||||
$moon->StructureName = $request->input('structure');
|
||||
$moon->FirstOre = $request->input('firstore');
|
||||
$moon->FirstQuantity = $request->input('firstquan');
|
||||
@@ -93,15 +95,17 @@ class MoonsController extends Controller
|
||||
|
||||
public function storeUpdateMoon(Request $request) {
|
||||
$this->validate($request, [
|
||||
'name' => 'required',
|
||||
'system' => 'required',
|
||||
'planet' => 'required',
|
||||
'moon' => 'required',
|
||||
'renter' => 'required',
|
||||
'date' => 'required'
|
||||
]);
|
||||
|
||||
$date = strtotime($request->date . '00:00:01');
|
||||
|
||||
DB::table('moons')
|
||||
->where('StructureName', $request->name)
|
||||
//Update the database entry
|
||||
DB::table('Moons')
|
||||
->whereColumn(['System', '=', $request->system], ['Planet', '=', $request->planet], ['Moon', '=', $request->moon])
|
||||
->update([
|
||||
'RentalCorp' => $request->renter,
|
||||
'RentalEnd' => $date,
|
||||
|
||||
23
app/Http/Controllers/WikiController.php
Normal file
23
app/Http/Controllers/WikiController.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use DB;
|
||||
|
||||
class WikiController extends Controller
|
||||
{
|
||||
public function displayRegister() {
|
||||
return view('wiki.register');
|
||||
}
|
||||
|
||||
public function storeRegister(Request $request) {
|
||||
$this->validate($request, [
|
||||
'password' => 'required',
|
||||
'password2' => 'required',
|
||||
]);
|
||||
|
||||
//Add the new user to the wiki
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,10 +12,10 @@ use Session;
|
||||
use DB;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\Client;
|
||||
use App\Config;
|
||||
use App\Moon;
|
||||
use App\Price;
|
||||
use App\ItemComposition;
|
||||
use App\Models\Config;
|
||||
use App\Models\Moon;
|
||||
use App\Models\Price;
|
||||
use App\Models\ItemComposition;
|
||||
|
||||
class MoonCalc {
|
||||
|
||||
|
||||
34
app/Models/User.php
Normal file
34
app/Models/User.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'email', 'avatar', 'owner_hash', 'character_id', 'expires_in', 'access_token', 'refresh_token', 'user_type',
|
||||
];
|
||||
|
||||
protected $table = 'users';
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -9,6 +9,10 @@
|
||||
{{ Form::text('region', '', ['class' => 'form-control', 'placeholder' => 'Region']) }}
|
||||
{{ Form::label('system', 'System') }}
|
||||
{{ Form::text('system', '', ['class' => 'form-control', 'placeholder' => 'System']) }}
|
||||
{{ Form::label('planet', 'Planet') }}
|
||||
{{ Form::text('planet', '', ['class' => 'form-control', 'placeholder' => 'Planet']) }}
|
||||
{{ Form::label('moon', 'Moon') }}
|
||||
{{ Form::text('moon', '', ['class' => 'form-control', 'placeholder' => 'Moon']) }}
|
||||
{{ Form::label('struture', 'Structure Name') }}
|
||||
{{ Form::text('structure', '', ['class' => 'form-control', 'placeholder' => 'Structure Name']) }}
|
||||
{{ Form::label('firstore', 'First Ore') }}
|
||||
|
||||
@@ -5,14 +5,18 @@
|
||||
<h2>Update Existing Moon</h2>
|
||||
{!! Form::open(['action' => 'MoonsController@storeUpdateMoon', 'method' => 'POST']) !!}
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('name', 'Structure Name') }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control', 'placeholder' => 'Name']) }}
|
||||
{{ Form::label('system', 'System') }}
|
||||
{{ Form::text('system', '', ['class' => 'form-control', 'placeholder' => 'Planet']) }}
|
||||
{{ Form::label('planet', 'Planet') }}
|
||||
{{ Form::text('planet', '', ['class' => 'form-control', 'placeholder' => 'Planet']) }}
|
||||
{{ Form::label('moon', 'Moon') }}
|
||||
{{ Form::text('moon', '', ['class' => 'form-control', 'placeholder' => 'Planet']) }}
|
||||
{{ Form::label('renter', 'Renter') }}
|
||||
{{ Form::text('renter', '', ['class' => 'form-control', 'placeholder' => 'Renter']) }}
|
||||
{{ Form::label('date', 'Rental End Date') }}
|
||||
{{ Form::text('date', '', ['class' => 'form-control', 'placeholder' => '01/01/1970'] )}}
|
||||
</div>
|
||||
{{ Form:;submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
16
resources/views/wiki/register.blade.php
Normal file
16
resources/views/wiki/register.blade.php
Normal file
@@ -0,0 +1,16 @@
|
||||
@extends('layouts.b4')
|
||||
@include('layouts.navbar')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2>Register for Warped Intentions Wiki<h2>
|
||||
{!! Form::open(['action' => 'WikiController@storeRegister', 'method' => 'POST']) !!}
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('password', 'Password') }}
|
||||
{{ Form::password('password', '', ['class' => 'form-control']) }}
|
||||
{{ Form::label('password2', 'Repeat Password') }}
|
||||
{{ Form::password('password2', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
@@ -27,5 +27,11 @@ Route::get('/dashboard', 'DashboardController@index');
|
||||
Route::get('/moons/display', 'MoonsController@displayMoons');
|
||||
Route::get('/moons/addmoon', 'MoonsController@addMoon');
|
||||
Route::get('/moons/updatemoon', 'MoonsController@updateMoon');
|
||||
//Moon Controller POSTS requests
|
||||
Route::post('moons', 'MoonsController@addMoon');
|
||||
//Moon Controller POST requests
|
||||
Route::post('storeMoon', 'MoonsController@addMoon');
|
||||
Route::post('storeUpdateMoon', 'MoonsController@storeUpdateMoon');
|
||||
|
||||
//Wiki Controller display pages
|
||||
Route::get('/wiki/register', 'WikiController@displayRegister');
|
||||
//Wiki Controller POST requests
|
||||
Route::post('storeRegister', 'WikiController@storeRegister');
|
||||
|
||||
Reference in New Issue
Block a user