diff --git a/.env.example b/.env.example index afbeae44..bab9c2dd 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,7 @@ APP_ENV=local APP_DEBUG=true APP_KEY=SomeRandomString +APP_URL= DB_HOST=127.0.0.1 DB_DATABASE=homestead @@ -11,10 +12,6 @@ CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 diff --git a/.gitignore b/.gitignore index 94d0c499..df398aa2 100755 --- a/.gitignore +++ b/.gitignore @@ -8,10 +8,13 @@ storage/ /.phpstorm.meta.php /.idea -/lva-server +/.vagrant +/puphpet /vendor /node_modules .env .env.* !.env.example _ide_helper.php +_ide_helper_models.php +/Vagrantfile diff --git a/.travis.yml b/.travis.yml index 1dbbe11c..78f52577 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,11 @@ +branches: + only: + - master + - dev +notifications: + email: + on_success: always + on_failure: always language: php php: - 5.6.30 diff --git a/Vagrantfile b/Vagrantfile index c2ab2ed6..e1bffc58 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,11 +4,12 @@ dir = File.dirname(File.expand_path(__FILE__)) require 'yaml' require "#{dir}/puphpet/ruby/deep_merge.rb" +require "#{dir}/puphpet/ruby/to_bool.rb" require "#{dir}/puphpet/ruby/puppet.rb" configValues = YAML.load_file("#{dir}/puphpet/config.yaml") -provider = ENV['VAGRANT_DEFAULT_PROVIDER'] +provider = ENV['VAGRANT_DEFAULT_PROVIDER'] ? ENV['VAGRANT_DEFAULT_PROVIDER'] : 'local' if File.file?("#{dir}/puphpet/config-#{provider}.yaml") custom = YAML.load_file("#{dir}/puphpet/config-#{provider}.yaml") configValues.deep_merge!(custom) @@ -23,4 +24,6 @@ data = configValues['vagrantfile'] Vagrant.require_version '>= 1.8.1' -eval File.read("#{dir}/puphpet/vagrant/Vagrantfile-#{data['target']}") +Vagrant.configure('2') do |config| + eval File.read("#{dir}/puphpet/vagrant/Vagrantfile-#{data['target']}") +end diff --git a/app/Console/Commands/Inspire.php b/app/Console/Commands/Inspire.php deleted file mode 100644 index db9ab854..00000000 --- a/app/Console/Commands/Inspire.php +++ /dev/null @@ -1,33 +0,0 @@ -comment(PHP_EOL.Inspiring::quote().PHP_EOL); - } -} diff --git a/app/Console/Commands/PurgeUploadJobs.php b/app/Console/Commands/PurgeUploadJobs.php new file mode 100644 index 00000000..4842ee18 --- /dev/null +++ b/app/Console/Commands/PurgeUploadJobs.php @@ -0,0 +1,51 @@ +uploadService = $uploadService; + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + $jobs = UploadJob::stale()->get(); + + foreach ($jobs as $job) { + $this->uploadService->cleanUp($job); + } + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 71c519d3..47aba48d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -1,9 +1,10 @@ all()); - \Flash::success('Appointment added!'); + Flash::success('Appointment added!'); return redirect('admin/data-management/available-appointments'); } @@ -82,23 +89,25 @@ public function edit($id) $fixtures = Fixture::all(); $roles = Role::all(); - return view('admin.data-management.available-appointments.edit', compact('availableAppointment', 'fixtures', 'roles')); + return view('admin.data-management.available-appointments.edit', + compact('availableAppointment', 'fixtures', 'roles')); } /** * Update the specified resource in storage. * - * @param AvailableAppointmentRequest $request - * @param int $id + * @param UpdateRequest $request + * @param int $id * * @return mixed */ - public function update(AvailableAppointmentRequest $request, $id) + public function update(UpdateRequest $request, $id) { + /** @var AvailableAppointment $availableAppointment */ $availableAppointment = AvailableAppointment::findOrFail($id); $availableAppointment->update($request->all()); - \Flash::success('Appointment updated!'); + Flash::success('Appointment updated!'); return redirect('admin/data-management/available-appointments'); } @@ -114,7 +123,7 @@ public function destroy($id) { AvailableAppointment::destroy($id); - \Flash::success('Appointment deleted!'); + Flash::success('Appointment deleted!'); return redirect('admin/data-management/available-appointments'); } diff --git a/app/Http/Controllers/Admin/DataManagement/ClubsController.php b/app/Http/Controllers/Admin/DataManagement/ClubsController.php index 62f200b9..ea21c7f2 100644 --- a/app/Http/Controllers/Admin/DataManagement/ClubsController.php +++ b/app/Http/Controllers/Admin/DataManagement/ClubsController.php @@ -1,13 +1,18 @@ all()); - \Flash::success('Club added!'); + Flash::success('Club added!'); return redirect('admin/data-management/clubs'); } @@ -54,7 +59,7 @@ public function store(Request $request) /** * Display the specified resource. * - * @param int $id + * @param int $id * * @return mixed */ @@ -68,7 +73,7 @@ public function show($id) /** * Show the form for editing the specified resource. * - * @param int $id + * @param int $id * * @return mixed */ @@ -83,7 +88,7 @@ public function edit($id) * Update the specified resource in storage. * * @param Request $request - * @param int $id + * @param int $id * * @return mixed */ @@ -91,10 +96,11 @@ public function update(Request $request, $id) { $this->validate($request, ['club' => 'required|unique:clubs,club,' . $id]); + /** @var Club $club */ $club = Club::findOrFail($id); $club->update($request->all()); - \Flash::success('Club updated!'); + Flash::success('Club updated!'); return redirect('admin/data-management/clubs'); } @@ -102,7 +108,7 @@ public function update(Request $request, $id) /** * Remove the specified resource from storage. * - * @param int $id + * @param int $id * * @return mixed */ @@ -111,11 +117,11 @@ public function destroy($id) $canBeDeleted = empty(Club::find($id)->teams->toArray()); if ($canBeDeleted) { Club::destroy($id); - \Flash::success('Club deleted!'); + Flash::success('Club deleted!'); } else { - \Flash::error('Cannot delete because they are existing teams in this club.'); + Flash::error('Cannot delete because they are existing teams in this club.'); } - + return redirect('admin/data-management/clubs'); } diff --git a/app/Http/Controllers/Admin/DataManagement/DivisionsController.php b/app/Http/Controllers/Admin/DataManagement/DivisionsController.php index 46ef7c0d..990decd9 100644 --- a/app/Http/Controllers/Admin/DataManagement/DivisionsController.php +++ b/app/Http/Controllers/Admin/DataManagement/DivisionsController.php @@ -1,15 +1,19 @@ validate($request, [ 'season_id' => 'required|exists:seasons,id', - 'division' => 'required|unique:divisions,division,NULL,id,season_id,' . $request->get('season_id'), + 'division' => 'required|unique:divisions,division,NULL,id,season_id,' . $request->input('season_id'), ]); Division::create($request->all()); - \Flash::success('Division added!'); + Flash::success('Division added!'); return redirect('admin/data-management/divisions'); } @@ -88,7 +92,7 @@ public function edit($id) * Update the specified resource in storage. * * @param Request $request - * @param int $id + * @param int $id * * @return mixed */ @@ -96,13 +100,14 @@ public function update(Request $request, $id) { $this->validate($request, [ 'season_id' => 'required|exists:seasons,id', - 'division' => 'required|unique:divisions,division,NULL,id,season_id,' . $request->get('season_id'), + 'division' => 'required|unique:divisions,division,' . $id . ',id,season_id,' . $request->input('season_id'), ]); + /** @var Division $division */ $division = Division::findOrFail($id); $division->update($request->all()); - \Flash::success('Division updated!'); + Flash::success('Division updated!'); return redirect('admin/data-management/divisions'); } @@ -119,9 +124,9 @@ public function destroy($id) $canBeDeleted = empty(Division::find($id)->fixtures->toArray()); if ($canBeDeleted) { Division::destroy($id); - \Flash::success('Division deleted!'); + Flash::success('Division deleted!'); } else { - \Flash::error('Cannot delete because they are existing fixtures in this division.'); + Flash::error('Cannot delete because they are existing fixtures in this division.'); } return redirect('admin/data-management/divisions'); diff --git a/app/Http/Controllers/Admin/DataManagement/FixturesController.php b/app/Http/Controllers/Admin/DataManagement/FixturesController.php index 6105d96b..292e57f8 100644 --- a/app/Http/Controllers/Admin/DataManagement/FixturesController.php +++ b/app/Http/Controllers/Admin/DataManagement/FixturesController.php @@ -1,16 +1,22 @@ validate($request, - [ - 'division_id' => - 'required|' . - 'exists:divisions,id|' . - 'unique:fixtures,division_id,NULL,id' . - ',home_team_id,' . $request->get('home_team_id') . - ',away_team_id,' . $request->get('away_team_id'), - 'match_number' => 'required|unique:fixtures,match_number,NULL,id,division_id,' . $request->get('division_id'), - 'match_date' => 'required', - 'warm_up_time' => 'required', - 'start_time' => 'required', - 'home_team_id' => 'required|exists:teams,id', - 'away_team_id' => 'required|exists:teams,id|different:home_team_id', - 'venue_id' => 'required|exists:venues,id', - ], - [ - 'away_team_id.different' => 'The away team cannot be the same as the home team.', - 'division_id.unique' => 'The fixture for these two teams have already been added in this division.', - 'match_number.unique' => 'There is already a match with the same number in this division.', - ] - ); - Fixture::create($request->all()); - \Flash::success('Fixture added!'); + Flash::success('Fixture added!'); return redirect('admin/data-management/fixtures'); } @@ -112,40 +95,18 @@ public function edit($id) /** * Update the specified resource in storage. * - * @param Request $request - * @param int $id + * @param UpdateRequest $request + * @param int $id * * @return mixed */ - public function update(Request $request, $id) + public function update(UpdateRequest $request, $id) { - $this->validate($request, - [ - 'division_id' => - 'required|' . - 'exists:divisions,id|' . - 'unique:fixtures,division_id,NULL,id' . - ',home_team_id,' . $request->get('home_team_id') . - ',away_team_id,' . $request->get('away_team_id'), - 'match_number' => 'required|unique:fixtures,match_number,NULL,id,division_id,' . $request->get('division_id'), - 'match_date' => 'required', - 'warm_up_time' => 'required', - 'start_time' => 'required', - 'home_team_id' => 'required|exists:teams,id', - 'away_team_id' => 'required|exists:teams,id|different:home_team_id', - 'venue_id' => 'required|exists:venues,id', - ], - [ - 'away_team_id.different' => 'The away team cannot be the same as the home team.', - 'division_id.unique' => 'The fixture for these two teams have already been added in this division.', - 'match_number.unique' => 'There is already a match with the same number in this division.', - ] - ); - + /** @var Fixture $fixture */ $fixture = Fixture::findOrFail($id); $fixture->update($request->all()); - \Flash::success('Fixture updated!'); + Flash::success('Fixture updated!'); return redirect('admin/data-management/fixtures'); } @@ -162,9 +123,9 @@ public function destroy($id) $canBeDeleted = empty(Fixture::find($id)->available_appointments->toArray()); if ($canBeDeleted) { Fixture::destroy($id); - \Flash::success('Fixture deleted!'); + Flash::success('Fixture deleted!'); } else { - \Flash::error('Cannot delete because they are existing appointments for this fixture.'); + Flash::error('Cannot delete because they are existing appointments for this fixture.'); } return redirect('admin/data-management/fixtures'); } diff --git a/app/Http/Controllers/Admin/DataManagement/LoadController.php b/app/Http/Controllers/Admin/DataManagement/LoadController.php new file mode 100644 index 00000000..e14a0de9 --- /dev/null +++ b/app/Http/Controllers/Admin/DataManagement/LoadController.php @@ -0,0 +1,59 @@ + + * Date: 23/08/2016 + * Time: 19:33 + */ + +namespace LVA\Http\Controllers\Admin\DataManagement; + +use LVA\Http\Controllers\Controller; + +use LVA\Models\UploadJob; +use LVA\Services\InteractiveFixturesUploadService as FileUploadService; +use Illuminate\Http\Request; +use LVA\Models\Season; +use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\Input; +use Illuminate\Support\Facades\Redirect; + +class LoadController extends Controller +{ + /** @var FileUploadService */ + private $uploadService; + + /** + * @inheritDoc + */ + public function __construct(FileUploadService $uploadService) + { + $this->uploadService = $uploadService; + } + + + public function uploadFixtures() + { + return view('admin.data-management.load.fixtures', ['seasons' => Season::all()]); + } + + public function startUploadFixtures(Request $request) + { + $this->validate($request, [ + 'season_id' => 'required|exists:seasons,id', + 'upload_file' => 'required|file|required_headers:Region,Code,Match,Home,Away,Date,WUTime,StartTime,Discipline,Hall', + ]); + + // Create upload job + $job = $this->uploadService->createJob($request->input('season_id'), $request->file('upload_file')); + + // Redirect to the status page + return Redirect::route('uploadStatus', ['job_id' => $job->getId()]); + } + + public function uploadStatus(UploadJob $uploadJob) + { + $uploadJob->save(); + return view('admin.data-management.load.status', ['job' => $uploadJob]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/DataManagement/RolesController.php b/app/Http/Controllers/Admin/DataManagement/RolesController.php index 0ec6395e..f5111e53 100644 --- a/app/Http/Controllers/Admin/DataManagement/RolesController.php +++ b/app/Http/Controllers/Admin/DataManagement/RolesController.php @@ -1,13 +1,18 @@ all()); - \Flash::success('Role added!'); + Flash::success('Role added!'); return redirect('admin/data-management/roles'); } @@ -82,7 +87,7 @@ public function edit($id) * Update the specified resource in storage. * * @param Request $request - * @param int $id + * @param int $id * * @return mixed */ @@ -90,10 +95,11 @@ public function update(Request $request, $id) { $this->validate($request, ['role' => 'required|unique:roles,role,' . $id]); + /** @var Role $role */ $role = Role::findOrFail($id); $role->update($request->all()); - \Flash::success('Role updated!'); + Flash::success('Role updated!'); return redirect('admin/data-management/roles'); } @@ -107,14 +113,14 @@ public function update(Request $request, $id) */ public function destroy($id) { - $canBeDeleted = empty(Role::find($id)->available_appointment->toArray()); + $canBeDeleted = empty(Role::find($id)->available_appointments->toArray()); if ($canBeDeleted) { Role::destroy($id); - \Flash::success('Role deleted!'); + Flash::success('Role deleted!'); } else { - \Flash::error('Cannot delete because they are existing appointments for this role.'); + Flash::error('Cannot delete because they are existing appointments for this role.'); } - + return redirect('admin/data-management/roles'); } diff --git a/app/Http/Controllers/Admin/DataManagement/SeasonsController.php b/app/Http/Controllers/Admin/DataManagement/SeasonsController.php index 2cfaf9a0..13a7ce5e 100644 --- a/app/Http/Controllers/Admin/DataManagement/SeasonsController.php +++ b/app/Http/Controllers/Admin/DataManagement/SeasonsController.php @@ -1,13 +1,19 @@ all()); - \Flash::success('Season added!'); + Flash::success('Season added!'); return redirect('admin/data-management/seasons'); } @@ -82,7 +88,7 @@ public function edit($id) * Update the specified resource in storage. * * @param Request $request - * @param int $id + * @param int $id * * @return mixed */ @@ -90,10 +96,11 @@ public function update(Request $request, $id) { $this->validate($request, ['season' => 'required|unique:seasons,season,' . $id]); + /** @var Season $season */ $season = Season::findOrFail($id); $season->update($request->all()); - \Flash::success('Season updated!'); + Flash::success('Season updated!'); return redirect('admin/data-management/seasons'); } @@ -110,9 +117,9 @@ public function destroy($id) $canBeDeleted = empty(Season::find($id)->divisions->toArray()); if ($canBeDeleted) { Season::destroy($id); - \Flash::success('Season deleted!'); + Flash::success('Season deleted!'); } else { - \Flash::error('Cannot delete because they are existing divisions in this season.'); + Flash::error('Cannot delete because they are existing divisions in this season.'); } return redirect('admin/data-management/seasons'); diff --git a/app/Http/Controllers/Admin/DataManagement/TeamsController.php b/app/Http/Controllers/Admin/DataManagement/TeamsController.php index bd6fd851..e4f82685 100644 --- a/app/Http/Controllers/Admin/DataManagement/TeamsController.php +++ b/app/Http/Controllers/Admin/DataManagement/TeamsController.php @@ -1,14 +1,19 @@ validate($request, [ 'club_id' => 'required|exists:clubs,id', - 'team' => 'required|unique:teams,team,NULL,id,club_id,' . $request->get('club_id'), + 'team' => 'required|unique:teams,team,NULL,id,club_id,' . $request->input('club_id'), ]); Team::create($request->all()); - \Flash::success('Team added!'); + Flash::success('Team added!'); return redirect('admin/data-management/teams'); } @@ -87,7 +92,7 @@ public function edit($id) * Update the specified resource in storage. * * @param Request $request - * @param int $id + * @param int $id * * @return mixed */ @@ -95,13 +100,14 @@ public function update(Request $request, $id) { $this->validate($request, [ 'club_id' => 'required|exists:clubs,id', - 'team' => 'required|unique:teams,team,NULL,id,club_id,' . $request->get('club_id'), + 'team' => 'required|unique:teams,team,' . $id . ',id,club_id,' . $request->input('club_id'), ]); - + + /** @var Team $team */ $team = Team::findOrFail($id); $team->update($request->all()); - \Flash::success('Team updated!'); + Flash::success('Team updated!'); return redirect('admin/data-management/teams'); } @@ -119,9 +125,9 @@ public function destroy($id) $canBeDeleted = empty($team->homeFixtures->toArray()) && empty($team->awayFixtures->toArray()); if ($canBeDeleted) { Team::destroy($id); - \Flash::success('Team deleted!'); + Flash::success('Team deleted!'); } else { - \Flash::error('Cannot delete because they are existing fixtures for this team.'); + Flash::error('Cannot delete because they are existing fixtures for this team.'); } return redirect('admin/data-management/teams'); diff --git a/app/Http/Controllers/Admin/DataManagement/VenuesController.php b/app/Http/Controllers/Admin/DataManagement/VenuesController.php index e8a96d29..9bf600f1 100644 --- a/app/Http/Controllers/Admin/DataManagement/VenuesController.php +++ b/app/Http/Controllers/Admin/DataManagement/VenuesController.php @@ -1,13 +1,18 @@ all()); - \Flash::success('Venue added!'); + Flash::success('Venue added!'); return redirect('admin/data-management/venues'); } @@ -82,7 +87,7 @@ public function edit($id) * Update the specified resource in storage. * * @param Request $request - * @param int $id + * @param int $id * * @return mixed */ @@ -90,10 +95,11 @@ public function update(Request $request, $id) { $this->validate($request, ['venue' => 'required|unique:venues,venue,' . $id]); + /** @var Venue $venue */ $venue = Venue::findOrFail($id); $venue->update($request->all()); - \Flash::success('Venue updated!'); + Flash::success('Venue updated!'); return redirect('admin/data-management/venues'); } @@ -110,11 +116,11 @@ public function destroy($id) $canBeDeleted = empty(Venue::find($id)->fixtures->toArray()); if ($canBeDeleted) { Venue::destroy($id); - \Flash::success('Venue deleted!'); + Flash::success('Venue deleted!'); } else { - \Flash::error('Cannot delete because they are existing fixtures at this venue.'); + Flash::error('Cannot delete because they are existing fixtures at this venue.'); } - + return redirect('admin/data-management/venues'); } diff --git a/app/Http/Controllers/Admin/DataManagementController.php b/app/Http/Controllers/Admin/DataManagementController.php index d907e368..b90df5a8 100644 --- a/app/Http/Controllers/Admin/DataManagementController.php +++ b/app/Http/Controllers/Admin/DataManagementController.php @@ -6,9 +6,9 @@ * Time: 11:07 */ -namespace App\Http\Controllers\Admin; +namespace LVA\Http\Controllers\Admin; -use App\Http\Controllers\Controller; +use LVA\Http\Controllers\Controller; class DataManagementController extends Controller { diff --git a/app/Http/Controllers/Api/v1/UploadApiController.php b/app/Http/Controllers/Api/v1/UploadApiController.php new file mode 100644 index 00000000..ae9f751d --- /dev/null +++ b/app/Http/Controllers/Api/v1/UploadApiController.php @@ -0,0 +1,194 @@ + + * Date: 26/09/2016 + * Time: 18:33 + */ + +namespace LVA\Http\Controllers\Api\v1; + +use Illuminate\Http\Request; +use LVA\Http\Controllers\Controller; +use LVA\Models\MappedTeam; +use LVA\Models\MappedVenue; +use LVA\Models\TeamSynonym; +use LVA\Models\UploadJob; +use LVA\Models\UploadJobStatus; +use LVA\Models\VenueSynonym; +use LVA\Services\InteractiveFixturesUploadService; +use Illuminate\Support\Facades\Input; +use LVA\Services\UploadDataService; + +class UploadApiController extends Controller +{ + /** @var InteractiveFixturesUploadService */ + private $uploadService; + /** @var UploadDataService */ + private $uploadDataService; + + /** + * @inheritDoc + */ + public function __construct(InteractiveFixturesUploadService $uploadService, UploadDataService $uploadDataService) + { + $this->uploadService = $uploadService; + $this->uploadDataService = $uploadDataService; + } + + /** + * @return \Illuminate\Http\JsonResponse + */ + public function resumeUpload() + { + $uploadJob = $this->checkForJob(); + if (!$uploadJob instanceof UploadJob) { + return response()->json($uploadJob); + } + + /** @var UploadJobStatus $status */ + $status = UploadJobStatus::factory($uploadJob->getStatus()); + + if (!$status->canResume()) { + return response()->json([ + 'Timestamp' => time(), + 'Error' => true, + 'Message' => 'Job cannot be resumed', + ]); + } + + $status->resume(); + + $uploadJob->setStatus($status->toArray())->save(); + + $this->uploadService->processJob($uploadJob); + + return response()->json([ + 'Timestamp' => time(), + 'Error' => false, + 'Message' => 'Job resumed', + ]); + } + + public function abandonUpload() + { + $uploadJob = $this->checkForJob(); + if (!$uploadJob instanceof UploadJob) { + return response()->json($uploadJob); + } + + /** @var UploadJobStatus $status */ + $status = UploadJobStatus::factory($uploadJob->getStatus()); + + if (!$status->isWaitingConfirmation()) { + return response()->json([ + 'Timestamp' => time(), + 'Error' => true, + 'Message' => 'Job cannot be abandoned', + ]); + } + + $this->uploadService->cleanUp($uploadJob); + + return response()->json([ + 'Timestamp' => time(), + 'Error' => false, + 'Message' => 'Job abandoned', + ]); + } + + public function getUploadStatus() + { + $uploadJob = $this->checkForJob(); + if (!$uploadJob instanceof UploadJob) { + return response()->json($uploadJob); + } + + /** @var UploadJobStatus $status */ + $status = UploadJobStatus::factory($uploadJob->getStatus()); + + return response()->json([ + 'Timestamp' => time(), + 'Error' => false, + 'Message' => 'Job found', + 'Status' => $status->toApiArray(), + ]); + } + + public function mapTeam(Request $request) + { + $this->validate($request, [ + 'job' => 'required|exists:upload_jobs,id', + 'name' => 'required', + 'newName' => 'required', + ]); + + $mappedTeam = new MappedTeam(); + $mappedTeam + ->setUploadJob($request->input('job')) + ->setName($request->input('name')) + ->setMappedTeam($request->input('newName')) + ->save(); + + $synonym = new TeamSynonym(); + $synonym + ->setSynonym($mappedTeam->getName()) + ->setTeam($request->input('newName')); + + $this->uploadDataService->add($request->input('job'), TeamSynonym::class, $synonym); + + return response()->json([ + 'success' => true, + ]); + } + + public function mapVenue(Request $request) + { + $this->validate($request, [ + 'job' => 'required|exists:upload_jobs,id', + 'name' => 'required', + 'newName' => 'required', + ]); + + $mappedVenue = new MappedVenue(); + $mappedVenue + ->setUploadJob($request->input('job')) + ->setName($request->input('name')) + ->setMappedVenue($request->input('newName')) + ->save(); + + $synonym = new VenueSynonym(); + $synonym + ->setSynonym($mappedVenue->getName()) + ->setVenue($request->input('newName')); + + $this->uploadDataService->add($request->input('job'), VenueSynonym::class, $synonym); + + return response()->json([ + 'success' => true, + ]); + } + + private function checkForJob() + { + $jobId = Input::get('job', null); + if (null === $jobId) { + return [ + 'Timestamp' => time(), + 'Error' => true, + 'Message' => 'Job parameter missing', + ]; + } + $uploadJob = UploadJob::find($jobId); + + if (is_null($uploadJob)) { + return [ + 'Timestamp' => time(), + 'Error' => true, + 'Message' => 'Job not found', + ]; + } + + return $uploadJob; + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 2d7b1a92..05407f47 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -1,10 +1,11 @@ 'required|max:255', - 'email' => 'required|email|max:255|unique:users', + 'name' => 'required|max:255', + 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:6', ]); } @@ -58,15 +59,16 @@ protected function validator(array $data) /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data * @return User */ protected function create(array $data) { return User::create([ - 'name' => $data['name'], - 'email' => $data['email'], - 'password' => bcrypt($data['password']), + 'name' => $data['name'], + 'email' => $data['email'], + 'password' => bcrypt($data['password']), + 'api_token' => Str::random(60), ]); } } diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 1ceed97b..d999aa74 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -1,8 +1,8 @@ [ - \App\Http\Middleware\EncryptCookies::class, + \LVA\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\VerifyCsrfToken::class, + \LVA\Http\Middleware\VerifyCsrfToken::class, ], 'api' => [ @@ -44,9 +44,9 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, + 'auth' => \LVA\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'guest' => \LVA\Http\Middleware\RedirectIfAuthenticated::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, ]; } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 67abcaea..cf630326 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -1,6 +1,6 @@ + 'required|' . + 'exists:divisions,id|' . + 'unique:fixtures,division_id,NULL,id' . + ',home_team_id,' . $this->input('home_team_id') . + ',away_team_id,' . $this->input('away_team_id'), + 'match_number' => + 'required|' . + 'unique:fixtures,match_number,NULL,id,division_id,' . $this->input('division_id'), + 'match_date' => 'required', + 'warm_up_time' => 'required', + 'start_time' => 'required', + 'home_team_id' => 'required|exists:teams,id', + 'away_team_id' => 'required|exists:teams,id|different:home_team_id', + 'venue_id' => 'required|exists:venues,id', + ]; + } + + /** + * @return array + */ + public function messages() + { + return [ + 'away_team_id.different' => 'The away team cannot be the same as the home team.', + 'division_id.unique' => 'The fixture for these two teams have already been added in this division.', + 'match_number.unique' => 'There is already a match with the same number in this division.', + ]; + } + + +} diff --git a/app/Http/Requests/UpdateAvailableAppointmentRequest.php b/app/Http/Requests/UpdateAvailableAppointmentRequest.php new file mode 100644 index 00000000..624a2759 --- /dev/null +++ b/app/Http/Requests/UpdateAvailableAppointmentRequest.php @@ -0,0 +1,47 @@ + 'unique:available_appointments,fixture_id,' . $this->input('id') . ',id,role_id,' . $this->input('role_id'), + 'role_id' => 'unique:available_appointments,role_id,' . $this->input('id') . ',id,fixture_id,' . $this->input('fixture_id'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function formatErrors(Validator $validator) + { + return [[ + 'Appointment already added.', + ]]; + } +} diff --git a/app/Http/Requests/UpdateFixtureRequest.php b/app/Http/Requests/UpdateFixtureRequest.php new file mode 100644 index 00000000..a8addb32 --- /dev/null +++ b/app/Http/Requests/UpdateFixtureRequest.php @@ -0,0 +1,61 @@ + + 'required|' . + 'exists:divisions,id|' . + 'unique:fixtures,division_id,' . $this->input('id') . ',id' . + ',home_team_id,' . $this->input('home_team_id') . + ',away_team_id,' . $this->input('away_team_id'), + 'match_number' => + 'required|' . + 'unique:fixtures,match_number,' . $this->input('id') . ',id,division_id,' . $this->input('division_id'), + 'match_date' => 'required', + 'warm_up_time' => 'required', + 'start_time' => 'required', + 'home_team_id' => 'required|exists:teams,id', + 'away_team_id' => 'required|exists:teams,id|different:home_team_id', + 'venue_id' => 'required|exists:venues,id', + ]; + } + + /** + * @return array + */ + public function messages() + { + return [ + 'away_team_id.different' => 'The away team cannot be the same as the home team.', + 'division_id.unique' => 'The fixture for these two teams have already been added in this division.', + 'match_number.unique' => 'There is already a match with the same number in this division.', + ]; + } +} diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index a1e3c356..98e30689 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -30,7 +30,7 @@ // Data Management Breadcrumbs::register('admin::dataManagement', function($b) { $b->parent('home'); - $b->push('Data Management', route('admin::dataManagement')); + $b->push('Data management', route('admin::dataManagement')); }); // Data Management - Seasons @@ -175,4 +175,15 @@ Breadcrumbs::register('admin.data-management.available-appointments.show', function ($b) { $b->parent('admin.data-management.available-appointments.index'); $b->push('View'); +}); + +// Data Management - Upload Fixtures +Breadcrumbs::register('uploadFixtures', function ($b) { + $b->parent('admin::dataManagement'); + $b->push('Upload fixtures', route('uploadFixtures')); +}); +// Data Management - Upload Fixtures - Staus +Breadcrumbs::register('uploadStatus', function ($b) { + $b->parent('uploadFixtures'); + $b->push('Status'); }); \ No newline at end of file diff --git a/app/Http/routes.php b/app/Http/routes.php index eeb330ed..dcda6b08 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -23,6 +23,14 @@ | kernel and includes session state, CSRF protection, and more. | */ +Route::group(['prefix' => 'api/v1', 'middleware' => 'auth:api', 'namespace' => 'Api\v1'], function () { + Route::get('uploads/status.json', ['as' => 'upload-status', 'uses' => 'UploadApiController@getUploadStatus']); + Route::post('maps/team', ['as' => 'loading-map-team', 'uses' => 'UploadApiController@mapTeam']); + Route::post('maps/venue', ['as' => 'loading-map-venue', 'uses' => 'UploadApiController@mapVenue']); + Route::get('uploads/resume', ['as' => 'resume-upload', 'uses' => 'UploadApiController@resumeUpload']); + Route::get('uploads/abandon', ['as' => 'abandon-upload', 'uses' => 'UploadApiController@abandonUpload']); +}); + Route::group(['middleware' => 'web'], function () { Route::get('/', ['as' => 'home', 'uses' => 'HomeController@showHome']); @@ -65,6 +73,12 @@ Route::resource('teams', 'TeamsController'); Route::resource('fixtures', 'FixturesController'); Route::resource('available-appointments', 'AvailableAppointmentsController'); + + Route::group(['prefix' => 'upload'], function () { + Route::get('fixtures', ['as' => 'uploadFixtures', 'uses' => 'LoadController@uploadFixtures']); + Route::post('fixtures', ['as' => 'uploadFixtures', 'uses' => 'LoadController@startUploadFixtures']); + Route::get('status/{uploadJob}', ['as' => 'uploadStatus', 'uses' => 'LoadController@uploadStatus']); + }); }); }); }); diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php index 55ece29a..6de3709d 100644 --- a/app/Jobs/Job.php +++ b/app/Jobs/Job.php @@ -1,6 +1,6 @@ belongsTo('App\Models\Fixture'); + return $this->belongsTo(Fixture::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function role() { - return $this->belongsTo('App\Models\Role'); + return $this->belongsTo(Role::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; } } diff --git a/app/Models/Club.php b/app/Models/Club.php index 914c76e4..d9d926a8 100644 --- a/app/Models/Club.php +++ b/app/Models/Club.php @@ -1,26 +1,16 @@ hasMany('App\Models\Team'); + return $this->hasMany(Team::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; } + /** + * @return string + */ + public function getName() + { + return $this->club; + } + + /** + * @return string + */ public function __toString() { return $this->club; diff --git a/app/Models/Division.php b/app/Models/Division.php index 6e4d8706..84f56d63 100644 --- a/app/Models/Division.php +++ b/app/Models/Division.php @@ -1,25 +1,13 @@ where('division', $division)->first(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function season() { - return $this->belongsTo('App\Models\Season'); + return $this->belongsTo(Season::class); } - + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function fixtures() { - return $this->hasMany('App\Models\Fixture'); + return $this->hasMany(Fixture::class); } + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getName() + { + return $this->division; + } + + /** + * @return string + */ public function __toString() { return $this->season . ' ' . $this->division; diff --git a/app/Models/Fixture.php b/app/Models/Fixture.php index a7819f5b..a3841c60 100644 --- a/app/Models/Fixture.php +++ b/app/Models/Fixture.php @@ -1,45 +1,17 @@ belongsTo('App\Models\Division'); + return $this->belongsTo(Division::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function home_team() { - return $this->belongsTo('App\Models\Team'); + return $this->belongsTo(Team::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function away_team() { - return $this->belongsTo('App\Models\Team'); + return $this->belongsTo(Team::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function venue() { - return $this->belongsTo('App\Models\Venue'); + return $this->belongsTo(Venue::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function available_appointments() { - return $this->hasMany('App\Models\AvailableAppointment'); + return $this->hasMany(AvailableAppointment::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; } - + + /** + * @param int $divisionId + * + * @return Fixture + */ + public function setDivision($divisionId) + { + $this->division_id = $divisionId; + + return $this; + } + + /** + * @param int $macthNumber + * + * @return Fixture + */ + public function setMatchNumber($macthNumber) + { + $this->match_number = $macthNumber; + + return $this; + } + + /** + * @param Carbon $date + * + * @return Fixture + */ + public function setMatchDate(Carbon $date) + { + $this->match_date = $date->format('Y-m-d'); + + return $this; + } + + /** + * @param Carbon $time + * + * @return Fixture + */ + public function setWarmUpTime(Carbon $time) + { + $this->warm_up_time = $time->format('H:i:s'); + + return $this; + } + + /** + * @param Carbon $time + * + * @return Fixture + */ + public function setStartTime(Carbon $time) + { + $this->start_time = $time->format('H:i:s'); + + return $this; + } + + /** + * @param int $teamId + * + * @return Fixture + */ + public function setHomeTeam($teamId) + { + $this->home_team_id = $teamId; + + return $this; + } + + /** + * @param int $teamId + * + * @return Fixture + */ + public function setAwayTeam($teamId) + { + $this->away_team_id = $teamId; + + return $this; + } + + /** + * @param int $venueId + * + * @return Fixture + */ + public function setVenue($venueId) + { + $this->venue_id = $venueId; + + return $this; + } + + /** + * @param string $time + * + * @return Carbon + */ public function getWarmUpTimeAttribute($time) { return Carbon::createFromFormat('H:i:s', $time); } + /** + * @param string $time + * + * @return Carbon + */ public function getStartTimeAttribute($time) { return Carbon::createFromFormat('H:i:s', $time); } + /** + * @param string $date + * + * @return Carbon + */ public function getMatchDateAttribute($date) { return Carbon::createFromFormat('Y-m-d', $date); } + /** + * @return string + */ public function __toString() { return diff --git a/app/Models/MappedTeam.php b/app/Models/MappedTeam.php new file mode 100644 index 00000000..de4a118b --- /dev/null +++ b/app/Models/MappedTeam.php @@ -0,0 +1,112 @@ + + * Date: 20/11/2016 + * Time: 15:28 + */ + +namespace LVA\Models; + +use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Model; + +/** + * Class MappedTeam + * + * @package LVA\Models + */ +class MappedTeam extends Model +{ + /** + * The database table used by the model. + * + * @var string + */ + protected $table = 'mapped_teams'; + + /** + * Attributes that should be mass-assignable. + * + * @var array + */ + protected $fillable = ['upload_job_id', 'mapped_team', 'team_id']; + + /** + * @param $jobId + * + * @return Collection + */ + public static function findByJob($jobId) + { + return self::where('upload_job_id', $jobId)->get(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function uploadJob() + { + return $this->belongsTo(UploadJob::class); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function team() + { + return $this->belongsTo(Team::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $jobId + * + * @return MappedTeam + */ + public function setUploadJob($jobId) + { + $this->upload_job_id = $jobId; + + return $this; + } + + /** + * @return mixed + */ + public function getName() + { + return $this->mapped_team; + } + + /** + * @param string $team + * + * @return MappedTeam + */ + public function setName($team) + { + $this->mapped_team = $team; + + return $this; + } + + /** + * @param string $team + * + * @return MappedTeam + */ + public function setMappedTeam($team) + { + $this->team()->associate(Team::findByName($team)); + + return $this; + } +} \ No newline at end of file diff --git a/app/Models/MappedVenue.php b/app/Models/MappedVenue.php new file mode 100644 index 00000000..525bef19 --- /dev/null +++ b/app/Models/MappedVenue.php @@ -0,0 +1,112 @@ + + * Date: 20/11/2016 + * Time: 16:05 + */ + +namespace LVA\Models; + +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Collection; + +/** + * Class MappedVenue + * + * @package LVA\Models + */ +class MappedVenue extends Model +{ + /** + * The database table used by the model. + * + * @var string + */ + protected $table = 'mapped_venues'; + + /** + * Attributes that should be mass-assignable. + * + * @var array + */ + protected $fillable = ['upload_job_id', 'mapped_venue', 'venue_id']; + + /** + * @param $jobId + * + * @return Collection + */ + public static function findByJob($jobId) + { + return self::where('upload_job_id', $jobId)->get(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function uploadJob() + { + return $this->belongsTo(UploadJob::class); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function venue() + { + return $this->belongsTo(Venue::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $jobId + * + * @return MappedVenue + */ + public function setUploadJob($jobId) + { + $this->upload_job_id = $jobId; + + return $this; + } + + /** + * @return mixed + */ + public function getName() + { + return $this->mapped_venue; + } + + /** + * @param string $venue + * + * @return MappedVenue + */ + public function setName($venue) + { + $this->mapped_venue = $venue; + + return $this; + } + + /** + * @param string $venue + * + * @return MappedVenue + */ + public function setMappedVenue($venue) + { + $this->venue()->associate(Venue::findByName($venue)); + + return $this; + } +} \ No newline at end of file diff --git a/app/Models/Role.php b/app/Models/Role.php index 70cdca04..96e8cd11 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -1,22 +1,13 @@ hasMany('App\Models\AvailableAppointment'); + return $this->hasMany(AvailableAppointment::class); } + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ public function __toString() { return $this->role; diff --git a/app/Models/Season.php b/app/Models/Season.php index 4b9171ab..d21b9364 100644 --- a/app/Models/Season.php +++ b/app/Models/Season.php @@ -1,26 +1,16 @@ hasMany('App\Models\Division'); + return $this->hasMany(Division::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; } + /** + * @return string + */ public function __toString() { return $this->season; diff --git a/app/Models/Team.php b/app/Models/Team.php index e6c8b2d3..fc396c7c 100644 --- a/app/Models/Team.php +++ b/app/Models/Team.php @@ -1,30 +1,16 @@ first(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function club() { - return $this->belongsTo('App\Models\Club'); + return $this->belongsTo(Club::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function awayFixtures() { - return $this->hasMany('App\Models\Fixture', 'away_team_id'); + return $this->hasMany(Fixture::class, 'away_team_id'); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function homeFixtures() { - return $this->hasMany('App\Models\Fixture', 'home_team_id'); + return $this->hasMany(Fixture::class, 'home_team_id'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function synonyms() + { + return $this->hasMany(TeamSynonym::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function mapped() + { + return $this->hasMany(MappedTeam::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getName() + { + return $this->team; + } + + /** + * @return string + */ public function __toString() { return $this->team; diff --git a/app/Models/TeamSynonym.php b/app/Models/TeamSynonym.php new file mode 100644 index 00000000..953b96a4 --- /dev/null +++ b/app/Models/TeamSynonym.php @@ -0,0 +1,97 @@ + + * Date: 20/11/2016 + * Time: 14:51 + */ + +namespace LVA\Models; + +use Illuminate\Database\Eloquent\Model; + +/** + * Class TeamSynonym + * + * @package LVA\Models + */ +class TeamSynonym extends Model +{ + /** + * The database table used by the model. + * + * @var string + */ + protected $table = 'teams_synonyms'; + + /** + * Attributes that should be mass-assignable. + * + * @var array + */ + protected $fillable = ['synonym', 'team_id']; + + /** + * @param string $synonym + * + * @return Team|null + */ + public static function findBySynonym($synonym) + { + /** @var TeamSynonym $synonym */ + $synonym = self::where('synonym', $synonym)->first(); + if ($synonym) { + return $synonym->team; + } + + return null; + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function team() + { + return $this->belongsTo(Team::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getSynonym() + { + return $this->synonym; + } + + /** + * @param string $synonym + * + * @return TeamSynonym + */ + public function setSynonym($synonym) + { + $this->synonym = $synonym; + + return $this; + } + + /** + * @param string $team + * + * @return TeamSynonym + */ + public function setTeam($team) + { + $this->team()->associate(Team::findByName($team)); + + return $this; + } +} \ No newline at end of file diff --git a/app/Models/UploadJob.php b/app/Models/UploadJob.php new file mode 100644 index 00000000..1898ef73 --- /dev/null +++ b/app/Models/UploadJob.php @@ -0,0 +1,162 @@ +hasMany(MappedTeam::class); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function mappedVenues() + { + return $this->hasMany(MappedVenue::class); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function uploadData() + { + return $this->hasMany(UploadJobData::class); + } + + /** + * @param Builder $query + * + * @return Builder + */ + public function scopeStale(Builder $query) + { + return $query->where('updated_at', '<=', Carbon::now()->subWeek()); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return int + */ + public function getSeason() + { + return $this->season_id; + } + + /** + * @param int $seasonId + * + * @return UploadJob + */ + public function setSeason($seasonId) + { + $this->season_id = $seasonId; + + return $this; + } + + /** + * @return string + */ + public function getFile() + { + return $this->file; + } + + /** + * @param string $filename + * + * @return UploadJob + */ + public function setFile($filename) + { + $this->file = $filename; + + return $this; + } + + /** + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * @param string $type + * + * @return UploadJob + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + + /** + * @return array + */ + public function getStatus() + { + return json_decode($this->status, true); + } + + /** + * @param array $status + * + * @return UploadJob + */ + public function setStatus($status) + { + $this->status = json_encode($status); + + return $this; + } + + /** + * @return int|null + */ + public function getRowCount() + { + return $this->row_count; + } + + /** + * @param int $count + * + * @return UploadJob + */ + public function setRowCount($count) + { + $this->row_count = $count; + + return $this; + } +} diff --git a/app/Models/UploadJobData.php b/app/Models/UploadJobData.php new file mode 100644 index 00000000..c49252ab --- /dev/null +++ b/app/Models/UploadJobData.php @@ -0,0 +1,112 @@ + + * Date: 20/11/2016 + * Time: 15:56 + */ + +namespace LVA\Models; + +use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Model; + +/** + * Class UploadJobData + * + * @package LVA\Models + */ +class UploadJobData extends Model +{ + /** + * The database table used by the model. + * + * @var string + */ + protected $table = 'upload_jobs_data'; + + /** + * Attributes that should be mass-assignable. + * + * @var array + */ + protected $fillable = ['upload_job_id', 'model', 'model_data']; + + /** + * @param $jobId + * + * @return Collection + */ + public static function findByJobId($jobId) + { + return self::where('upload_job_id', $jobId)->orderBy('id', 'asc')->get(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function uploadJob() + { + return $this->belongsTo(UploadJob::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $jobId + * + * @return UploadJobData + */ + public function setJob($jobId) + { + $this->uploadJob()->associate(UploadJob::find($jobId)); + + return $this; + } + + /** + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * @param string $model + * + * @return UploadJobData + */ + public function setModel($model) + { + $this->model = $model; + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->model_data; + } + + /** + * @param string $data + * + * @return UploadJobData + */ + public function setData($data) + { + $this->model_data = $data; + + return $this; + } +} \ No newline at end of file diff --git a/app/Models/UploadJobStatus.php b/app/Models/UploadJobStatus.php new file mode 100644 index 00000000..4c3098c3 --- /dev/null +++ b/app/Models/UploadJobStatus.php @@ -0,0 +1,646 @@ + + * Date: 05/02/2017 + * Time: 12:13 + */ + +namespace LVA\Models; + +use Carbon\Carbon; + +/** + * Class UploadJobStatus + * + * NOTE: This model does not extend the Eloquent Model class because it is not + * to be store in the DB. It's just a convenient way to encapsulate all + * the data and functionality needed for the status + * + * @package LVA\Models + */ +class UploadJobStatus +{ + const STATUS_NOT_STARTED = 0; + const STATUS_VALIDATING_RECORDS = 10; + const STATUS_UNKNOWN_DATA = 11; + const STATUS_UNRECOVERABLE_VALIDATION_ERROR = 19; + const STATUS_WAITING_CONFIRMATION_TO_INSERT = 20; + const STATUS_INSERTING_RECORDS = 30; + const STATUS_UNRECOVERABLE_INSERT_ERROR = 39; + const STATUS_DONE = 99; + + const UNKNOWN_HOME_TEAM = 1; + const UNKNOWN_AWAY_TEAM = 2; + const UNKNOWN_VENUE = 3; + + public $status_code; + public $total_lines; + public $processed_lines; + public $total_rows; + public $processed_rows; + public $processing_line; + public $unknowns; + public $errors; + public $error_line; + + /** + * UploadJobStatus constructor. + */ + public function __construct() + { + $this->status_code = self::STATUS_NOT_STARTED; + $this->total_lines = 0; + $this->processed_lines = 0; + $this->total_rows = 0; + $this->processed_rows = 0; + $this->processing_line = []; + $this->unknowns = []; + $this->errors = []; + $this->error_line = null; + } + + /** + * @param array $statusArray + * + * @return UploadJobStatus + */ + public static function factory($statusArray) + { + $status = new static(); + $status->load($statusArray); + + return $status; + } + + /** + * @return string + */ + public function getStatusCodeMessage() + { + switch ($this->status_code) { + case self::STATUS_NOT_STARTED: + return 'Not started'; + case self::STATUS_VALIDATING_RECORDS: + return 'Validating records'; + case self::STATUS_WAITING_CONFIRMATION_TO_INSERT: + return 'Waiting for confirmation from user'; + case self::STATUS_INSERTING_RECORDS: + return 'Inserting records'; + case self::STATUS_UNKNOWN_DATA: + return 'Unknown data'; + case self::STATUS_UNRECOVERABLE_VALIDATION_ERROR: + case self::STATUS_UNRECOVERABLE_INSERT_ERROR: + return 'Unrecoverable error'; + case self::STATUS_DONE: + return 'Done'; + default: + return "Status code {$this->status_code} not recognised"; + } + } + + /** + * @param array $data + * + * @return UploadJobStatus + */ + public function load(array $data) + { + $this->status_code = $data['status_code']; + + $this->total_lines = array_has($data, 'total_lines') ? $data['total_lines'] : 0; + $this->processed_lines = array_has($data, 'processed_lines') ? $data['processed_lines'] : 0; + $this->total_rows = array_has($data, 'total_rows') ? $data['total_rows'] : 0; + $this->processed_rows = array_has($data, 'processed_rows') ? $data['processed_rows'] : 0; + $this->processing_line = array_has($data, 'processing_line') ? $data['processing_line'] : []; + $this->unknowns = array_has($data, 'unknowns') ? $data['unknowns'] : []; + $this->errors = array_has($data, 'errors') ? $data['errors'] : []; + $this->error_line = array_has($data, 'error_line') ? $data['error_line'] : null; + + return $this; + } + + /** + * @return array + */ + public function toArray() + { + return [ + 'status_code' => $this->getStatusCode(), + 'total_lines' => $this->getTotalLines(), + 'processed_lines' => $this->getProcessedLines(), + 'total_rows' => $this->getTotalRows(), + 'processed_rows' => $this->getProcessedRows(), + 'processing_line' => $this->processing_line, + 'unknowns' => $this->getUnknowns(), + 'errors' => $this->getErrors(), + 'error_line' => $this->getErrorLine(), + ]; + } + + /** + * @return array + */ + public function toApiArray() + { + $formattedStatus = [ + 'StatusCode' => $this->getStatusCode(), + 'StatusMessage' => $this->getStatusCodeMessage(), + ]; + + if ($this->hasStarted() && !$this->isWaitingConfirmation() && !$this->isDone()) { + if ($this->isInserting()) { + $formattedStatus['Progress'] = floor($this->getProcessedRows() * 100 / $this->getTotalRows()); + } else { + $formattedStatus['Progress'] = floor($this->getProcessedLines() * 100 / $this->getTotalLines()); + } + + if ($this->hasErrors()) { + $formattedStatus['Errors'] = $this->getErrors(); + $formattedStatus['ErrorLine'] = $this->getErrorLine(); + + } elseif ($this->hasUnknownData()) { + $formattedStatus['Fixture'] = [ + 'Division' => $this->getProcessingLineDivision(), + 'MatchNumber' => $this->getProcessingLineMatchNumber(), + 'HomeTeam' => $this->getProcessingLineHomeTeam(), + 'AwayTeam' => $this->getProcessingLineAwayTeam(), + 'Date' => $this->getProcessingLineDate(), + 'WarmUpTime' => $this->getProcessingLineWarmUpTime(), + 'StartTime' => $this->getProcessingLineStartTime(), + 'Venue' => $this->getProcessingLineVenue(), + ]; + + foreach ($this->getUnknowns() as $unknownType => $mappings) { + switch ($unknownType) { + case UploadJobStatus::UNKNOWN_HOME_TEAM: + $formattedStatus['Unknowns']['HomeTeam'] = [ + 'Mapping' => $mappings, + 'ApiUrls' => [ + 'Map' => route('loading-map-team'), + ], + ]; + break; + case UploadJobStatus::UNKNOWN_AWAY_TEAM: + $formattedStatus['Unknowns']['AwayTeam'] = [ + 'Mapping' => $mappings, + 'ApiUrls' => [ + 'Map' => route('loading-map-team'), + ], + ]; + break; + case UploadJobStatus::UNKNOWN_VENUE: + $formattedStatus['Unknowns']['Venue'] = [ + 'Mapping' => $mappings, + 'ApiUrls' => [ + 'Map' => route('loading-map-venue'), + ], + ]; + break; + } + } + } + } + + return $formattedStatus; + } + + /** + * @return bool + */ + public function hasNotStarted() + { + return $this->status_code === self::STATUS_NOT_STARTED; + } + + /** + * @return bool + */ + public function hasStarted() + { + return !$this->hasNotStarted(); + } + + /** + * @return bool + */ + public function isValidating() + { + return $this->status_code === self::STATUS_VALIDATING_RECORDS; + } + + /** + * @return bool + */ + public function isWaitingConfirmation() + { + return $this->status_code === self::STATUS_WAITING_CONFIRMATION_TO_INSERT; + } + + /** + * @return bool + */ + public function isInserting() + { + return $this->status_code === self::STATUS_INSERTING_RECORDS; + } + + /** + * @return bool + */ + public function isDone() + { + return $this->status_code === self::STATUS_DONE; + } + + /** + * @return bool + */ + public function hasUnknownData() + { + return $this->status_code === self::STATUS_UNKNOWN_DATA; + } + + /** + * @return bool + */ + public function canResume() + { + return $this->hasNotStarted() || $this->hasUnknownData() || $this->isWaitingConfirmation(); + } + + /** + * @return bool + */ + public function isWorking() + { + return $this->isValidating() || $this->isInserting(); + } + + /** + * @return array + */ + public function getUnknowns() + { + if (empty($this->unknowns)) { + return []; + } + + return $this->unknowns; + } + + /** + * @param int $unknownType + * @param array $mappings + */ + public function setUnknown($unknownType, $mappings) + { + $this->status_code = self::STATUS_UNKNOWN_DATA; + $this->unknowns[$unknownType] = $mappings; + } + + /** + * @return bool + */ + public function hasErrors() + { + return in_array($this->getStatusCode(), + [self::STATUS_UNRECOVERABLE_VALIDATION_ERROR, self::STATUS_UNRECOVERABLE_INSERT_ERROR]); + } + + /** + * @return string[] + */ + public function getErrors() + { + if (empty($this->errors)) { + return []; + } + + return $this->errors; + } + + /** + * @param string[] $errors + * @param int $errorLine + */ + public function setValidationErrors($errors, $errorLine) + { + $this->setErrors(self::STATUS_UNRECOVERABLE_VALIDATION_ERROR, $errors, $errorLine); + } + + /** + * @param string $error + */ + public function setInsertingError($error) + { + $this->setErrors(self::STATUS_UNRECOVERABLE_INSERT_ERROR, [$error]); + } + + /** + * @return int|null + */ + public function getErrorLine() + { + return $this->error_line; + } + + /** + * @return int + */ + public function getStatusCode() + { + return $this->status_code; + } + + /** + * @return int + */ + public function getTotalLines() + { + return $this->total_lines; + } + + /** + * @param int $total_lines + * + * @return UploadJobStatus + */ + public function setTotalLines($total_lines) + { + $this->total_lines = $total_lines; + + return $this; + } + + /** + * @return int + */ + public function getProcessedLines() + { + return $this->processed_lines; + } + + /** + * @param int $processed_lines + * + * @return UploadJobStatus + */ + public function setProcessedLines($processed_lines) + { + $this->processed_lines = $processed_lines; + + return $this; + } + + /** + * @return int + */ + public function getTotalRows() + { + return $this->total_rows; + } + + /** + * @param int $total_rows + * + * @return UploadJobStatus + */ + public function setTotalRows($total_rows) + { + $this->total_rows = $total_rows; + + return $this; + } + + /** + * @return int + */ + public function getProcessedRows() + { + return $this->processed_rows; + } + + /** + * @param int $processed_rows + * + * @return UploadJobStatus + */ + public function setProcessedRows($processed_rows) + { + $this->processed_rows = $processed_rows; + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineDivision() + { + return isset($this->processing_line['division']) ? $this->processing_line['division'] : ''; + } + + /** + * @param string $division + * + * @return UploadJobStatus + */ + public function setProcessingLineDivision($division) + { + $this->processing_line['division'] = $division; + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineMatchNumber() + { + return isset($this->processing_line['match_number']) ? $this->processing_line['match_number'] : ''; + } + + /** + * @param string $matchNumber + * + * @return UploadJobStatus + */ + public function setProcessingLineMatchNumber($matchNumber) + { + $this->processing_line['match_number'] = $matchNumber; + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineHomeTeam() + { + return isset($this->processing_line['home_team']) ? $this->processing_line['home_team'] : ''; + } + + /** + * @param string $team + * + * @return UploadJobStatus + */ + public function setProcessingLineHomeTeam($team) + { + $this->processing_line['home_team'] = $team; + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineAwayTeam() + { + return isset($this->processing_line['away_team']) ? $this->processing_line['away_team'] : ''; + } + + /** + * @param string $team + * + * @return UploadJobStatus + */ + public function setProcessingLineAwayTeam($team) + { + $this->processing_line['away_team'] = $team; + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineDate() + { + return isset($this->processing_line['date']) ? $this->processing_line['date'] : ''; + } + + /** + * @param string $date + * + * @return UploadJobStatus + */ + public function setProcessingLineDate($date) + { + $this->processing_line['date'] = Carbon::createFromFormat('d/m/Y', $date)->format('D, d/m/Y'); + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineWarmUpTime() + { + return isset($this->processing_line['warm_up_time']) ? $this->processing_line['warm_up_time'] : ''; + } + + /** + * @param string $time + * + * @return UploadJobStatus + */ + public function setProcessingLineWarmUpTime($time) + { + $this->processing_line['warm_up_time'] = Carbon::createFromFormat('H:i:s', $time)->format('H:i'); + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineStartTime() + { + return isset($this->processing_line['start_time']) ? $this->processing_line['start_time'] : ''; + } + + /** + * @param string $time + * + * @return UploadJobStatus + */ + public function setProcessingLineStartTime($time) + { + $this->processing_line['start_time'] = Carbon::createFromFormat('H:i:s', $time)->format('H:i'); + + return $this; + } + + /** + * @return string + */ + public function getProcessingLineVenue() + { + return isset($this->processing_line['venue']) ? $this->processing_line['venue'] : ''; + } + + /** + * @param string $venue + * + * @return UploadJobStatus + */ + public function setProcessingLineVenue($venue) + { + $this->processing_line['venue'] = $venue; + + return $this; + } + + /** + * @return UploadJobStatus + */ + public function moveForward() + { + switch ($this->status_code) { + case self::STATUS_NOT_STARTED: + $this->status_code = self::STATUS_VALIDATING_RECORDS; + break; + case self::STATUS_VALIDATING_RECORDS: + $this->status_code = self::STATUS_WAITING_CONFIRMATION_TO_INSERT; + break; + case self::STATUS_INSERTING_RECORDS: + $this->status_code = self::STATUS_DONE; + break; + case self::STATUS_DONE: + break; + default: + throw new \RuntimeException("Invalid status code {$this->status_code}."); + } + + return $this; + } + + /** + * @return UploadJobStatus + */ + public function resume() + { + if ($this->status_code === self::STATUS_UNKNOWN_DATA) { + $this->status_code = self::STATUS_VALIDATING_RECORDS; + $this->unknowns = null; + } elseif ($this->status_code === self::STATUS_WAITING_CONFIRMATION_TO_INSERT) { + $this->status_code = self::STATUS_INSERTING_RECORDS; + $this->processing_line = null; + } + + return $this; + } + + /** + * @param string[] $errors + * @param int|null $errorLine + */ + private function setErrors($statusCode, $errors, $errorLine = null) + { + $this->status_code = $statusCode; + $this->errors = $errors; + $this->error_line = $errorLine; + } +} \ No newline at end of file diff --git a/app/Models/Venue.php b/app/Models/Venue.php index 01dc56bd..fa43e4aa 100644 --- a/app/Models/Venue.php +++ b/app/Models/Venue.php @@ -1,26 +1,16 @@ first(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function fixtures() { - return $this->hasMany('App\Models\Fixture'); + return $this->hasMany(Fixture::class); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function synonyms() + { + return $this->hasMany(VenueSynonym::class); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function mapped() + { + return $this->hasMany(MappedVenue::class); + } + + /** + * @return mixed + */ + public function getId() + { + return $this->id; } + /** + * @return mixed + */ + public function getName() + { + return $this->venue; + } + + /** + * @return string + */ public function __toString() { return $this->venue; diff --git a/app/Models/VenueSynonym.php b/app/Models/VenueSynonym.php new file mode 100644 index 00000000..ae1f4f86 --- /dev/null +++ b/app/Models/VenueSynonym.php @@ -0,0 +1,91 @@ +first(); + if ($synonym) { + return $synonym->venue; + } + + return null; + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function venue() + { + return $this->belongsTo(Venue::class); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getSynonym() + { + return $this->synonym; + } + + /** + * @param string $synonym + * + * @return VenueSynonym + */ + public function setSynonym($synonym) + { + $this->synonym = $synonym; + + return $this; + } + + /** + * @param string $venue + * + * @return VenueSynonym + */ + public function setVenue($venue) + { + $this->venue()->associate(Venue::findByName($venue)); + + return $this; + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a8a7e95d..0f022439 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,8 +1,10 @@ app->environment('local')) + if ($this->app->environment() == 'local') { $this->app->register('Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider'); $this->app->register('Appzcoder\CrudGenerator\CrudGeneratorServiceProvider'); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 57d88ea3..c6306879 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -1,6 +1,6 @@ 'App\Policies\ModelPolicy', + //'App\Model' => 'App\Policies\ModelPolicy', ]; /** diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 58ce9624..6609fefc 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -1,6 +1,6 @@ [ - 'App\Listeners\EventListener', - ], + //'App\Events\SomeEvent' => [ + // 'App\Listeners\EventListener', + //], ]; /** diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index d50b1c0f..a2f93e20 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -1,7 +1,8 @@ model('uploadJob', UploadJob::class); } /** diff --git a/app/Repositories/TeamsRepository.php b/app/Repositories/TeamsRepository.php new file mode 100644 index 00000000..8045ab77 --- /dev/null +++ b/app/Repositories/TeamsRepository.php @@ -0,0 +1,88 @@ +modelsById[$id])) { + return $this->modelsById[$id]; + } + + /** @var Team $model */ + $model = Team::find($id); + if ($model) { + $this->modelsById[$id] = $model; + return $model; + } + return null; + } + + /** + * @param string $name + * + * @return Team|null + */ + public function findByName($name) + { + if (isset($this->modelsByName[$name])) { + return $this->modelsByName[$name]; + } + + /** @var Team $model */ + $model = Team::findByName($name); + if ($model) { + $this->modelsByName[$name] = $model; + return $model; + } else { + $model = TeamSynonym::findBySynonym($name); + if ($model) { + $this->modelsByName[$name] = $model; + return $model; + } + } + return null; + } + + public function findByNameWithinMapped(UploadJob $job, $team) + { + $jobId = $job->getId(); + if (is_null($this->mappedModelsByName[$jobId])) { + /** @var MappedTeam $mappedTeam */ + foreach (MappedTeam::findByJob($jobId) as $mappedTeam) { + $this->mappedModelsByName[$jobId][$mappedTeam->getName()] = $mappedTeam->team; + } + } + + if (isset($this->mappedModelsByName[$jobId][$team])) { + return $this->mappedModelsByName[$jobId][$team]; + } else { + return null; + } + } + +} \ No newline at end of file diff --git a/app/Repositories/VenuesRepository.php b/app/Repositories/VenuesRepository.php new file mode 100644 index 00000000..d84fcf2f --- /dev/null +++ b/app/Repositories/VenuesRepository.php @@ -0,0 +1,86 @@ +modelsById[$id])) { + return $this->modelsById[$id]; + } + + /** @var Venue $model */ + $model = Venue::find($id); + if ($model) { + $this->modelsById[$id] = $model; + return $model; + } + return null; + } + + /** + * @param string $name + * + * @return Venue|null + */ + public function findByName($name) + { + if (isset($this->modelsByName[$name])) { + return $this->modelsByName[$name]; + } + + /** @var Venue $model */ + $model = Venue::findByName($name); + if ($model) { + $this->modelsByName[$name] = $model; + return $model; + } else { + $model = VenueSynonym::findBySynonym($name); + if ($model) { + $this->modelsByName[$name] = $model; + return $model; + } + } + return null; + } + + public function findByNameWithinMapped(UploadJob $job, $venue) + { + $jobId = $job->getId(); + if (is_null($this->mappedModelsByName[$jobId])) { + /** @var MappedVenue $mappedVenue */ + foreach (MappedVenue::findByJob($jobId) as $mappedVenue) { + $this->mappedModelsByName[$jobId][$mappedVenue->getName()] = $mappedVenue->venue; + } + } + + if (isset($this->mappedModelsByName[$jobId][$venue])) { + return $this->mappedModelsByName[$jobId][$venue]; + } else { + return null; + } + } +} \ No newline at end of file diff --git a/app/Services/Contracts/InteractiveUploadContract.php b/app/Services/Contracts/InteractiveUploadContract.php new file mode 100644 index 00000000..fef91bb1 --- /dev/null +++ b/app/Services/Contracts/InteractiveUploadContract.php @@ -0,0 +1,30 @@ + + * Date: 10/09/2016 + * Time: 16:22 + */ + +namespace LVA\Services\Contracts; + +use LVA\Models\UploadJob; +use Illuminate\Http\UploadedFile; + +interface InteractiveUploadContract +{ + /** + * @param int $seasonId + * @param UploadedFile $file + * + * @return mixed + */ + public function createJob($seasonId, UploadedFile $file); + + /** + * @param UploadJob $job + * + * @return mixed + */ + public function processJob(UploadJob $job); +} \ No newline at end of file diff --git a/app/Services/InteractiveFixturesUploadService.php b/app/Services/InteractiveFixturesUploadService.php new file mode 100644 index 00000000..6dbfdd7c --- /dev/null +++ b/app/Services/InteractiveFixturesUploadService.php @@ -0,0 +1,356 @@ + + * Date: 10/09/2016 + * Time: 15:32 + */ + +namespace LVA\Services; + +use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\DB; +use LVA\Models\Division; +use LVA\Models\Fixture; +use LVA\Models\Team; +use LVA\Models\UploadJobData; +use LVA\Models\UploadJobStatus; +use LVA\Models\Venue; +use LVA\Repositories\TeamsRepository; +use LVA\Repositories\VenuesRepository; +use LVA\Services\Contracts\InteractiveUploadContract; +use Carbon\Carbon; +use Illuminate\Http\UploadedFile; +use LVA\Models\UploadJob; +use Illuminate\Support\Facades\Validator; + +class InteractiveFixturesUploadService implements InteractiveUploadContract +{ + const UPLOAD_DIR = '/app/files/'; + + /** @var UploadDataService */ + private $uploadDataService; + /** @var MappingService */ + private $mappingService; + + /** @var TeamsRepository */ + private $teamsRepository; + /** @var VenuesRepository */ + private $venuesRepository; + + /** + * @inheritDoc + */ + public function __construct( + UploadDataService $uploadDataService, + MappingService $mappingService, + TeamsRepository $teamsRepository, + VenuesRepository $venuesRepository + ) + { + $this->uploadDataService = $uploadDataService; + $this->mappingService = $mappingService; + + $this->teamsRepository = $teamsRepository; + $this->venuesRepository = $venuesRepository; + } + + /** + * @param resource $handle + * + * @return array + */ + public static function readOneLine(&$handle) + { + $line = []; + foreach (explode(',', str_replace(['"', "\n", "\r"], '', fgets($handle))) as $field) { + if (is_numeric($field)) { + $line[] = (int)$field; + } else { + $line[] = $field; + } + } + + return $line; + } + + /************************************ + * INTERFACE IMPLEMENTATION METHODS * + ************************************/ + + /** + * @inheritdoc + */ + public function createJob($seasonId, UploadedFile $file) + { + $job = new UploadJob(); + $job->setSeason($seasonId) + ->setFile($file->getClientOriginalName()) + ->setType(UploadJob::TYPE_FIXTURES) + ->setStatus((new UploadJobStatus())->toArray()) + ->save(); + + /** @var UploadedFile $fixtureFile */ + $fixtureFile = $file->move(storage_path() . self::UPLOAD_DIR, $job->getId() . '.csv'); + + $handle = fopen($fixtureFile->getRealPath(), 'rb'); + $lines = 0; + while (!feof($handle)) { + $lines += substr_count(fread($handle, 8192), "\n"); + } + fclose($handle); + + $job->setRowCount($lines - 1)// Don't count the first line as they are the headers + ->save(); + + return $job; + } + + /** + * @inheritDoc + */ + public function processJob(UploadJob $job) + { + /** @var UploadJobStatus $status */ + $status = UploadJobStatus::factory($job->getStatus()); + + if ($status->hasNotStarted()) { + $status->moveForward()->setTotalLines($job->getRowCount()); + $job->setStatus($status->toArray())->save(); + } + + if ($status->isValidating()) { + $processedLines = $status->getProcessedLines(); + + /** @var resource $csvFile */ + $csvFile = fopen(storage_path() . self::UPLOAD_DIR . $job->getId() . '.csv', 'r'); + + // Get the headers + $headers = self::readOneLine($csvFile); + + // Skip already processed lines + $this->getIntoPosition($csvFile, $processedLines); + + // Start processing + $allLinesProcessed = true; + while (!feof($csvFile)) { + $line = self::readOneLine($csvFile); + if (empty($line) || count($headers) != count($line)) { + continue; + } + $row = array_combine($headers, $line); + + $validator = Validator::make($row, [ + 'Code' => 'required', + 'Match' => 'required|integer|min:1', + 'Home' => 'required', + 'Away' => 'required', + 'Date' => 'required|date_format:d/m/Y', + 'WUTime' => 'required|date_format:H:i:00', + 'StartTime' => 'required|date_format:H:i:00', + 'Hall' => 'required', + ]); + + if ($validator->fails()) { + $status->setValidationErrors($validator->errors()->all(), $processedLines + 2); + $allLinesProcessed = false; + break; + } + + unset($validator); + + // Store the current line + $status + ->setProcessingLineDivision($row['Code']) + ->setProcessingLineMatchNumber($row['Match']) + ->setProcessingLineHomeTeam($row['Home']) + ->setProcessingLineAwayTeam($row['Away']) + ->setProcessingLineDate($row['Date']) + ->setProcessingLineWarmUpTime($row['WUTime']) + ->setProcessingLineStartTime($row['StartTime']) + ->setProcessingLineVenue($row['Hall']); + + // Skip lines that are not for London or indoor volleyball + if ($row['Region'] != 'L' || $row['Discipline'] != 'I') { + // Update the line counter + $status->setProcessedLines(++$processedLines); + $job->setStatus($status->toArray())->save(); + continue; + } + + // Skip lines that are for divisions not in the system for the selected season + $division = Division::findByName($job->getSeason(), $row['Code']); + if (is_null($division)) { + // Update the line counter + $status->setProcessedLines(++$processedLines); + $job->setStatus($status->toArray())->save(); + continue; + } + + /** @var Team|null $homeTeam */ + $homeTeam = $this->teamsRepository->findByName($row['Home']); + /** @var Team|null $awayTeam */ + $awayTeam = $this->teamsRepository->findByName($row['Away']); + /** @var Venue|null $venue */ + $venue = $this->venuesRepository->findByName($row['Hall']); + + $isValid = true; + + if (is_null($homeTeam)) { + // We can't find an existing team matching this one, so checked the + // one mapped during this job + $homeTeam = $this->teamsRepository->findByNameWithinMapped($job, $row['Home']); + if (is_null($homeTeam)) { + // Nope, can't find it, so ask the user what to do + $mappings = $this->mappingService->findTeamMappings($division->getId(), $row['Home']); + $status->setUnknown(UploadJobStatus::UNKNOWN_HOME_TEAM, $mappings); + + $allLinesProcessed = false; + $isValid = false; + } + } + if (is_null($awayTeam)) { + // We can't find an existing team matching this one, so checked the + // one mapped during this job + $awayTeam = $this->teamsRepository->findByNameWithinMapped($job, $row['Away']); + if (is_null($awayTeam)) { + // Nope, can't find it, so ask the user what to do + $mappings = $this->mappingService->findTeamMappings($division->getId(), $row['Away']); + $status->setUnknown(UploadJobStatus::UNKNOWN_AWAY_TEAM, $mappings); + + $allLinesProcessed = false; + $isValid = false; + } + } + if (is_null($venue)) { + // We can't find an existing venue matching this one, so checked the + // one mapped during this job + $venue = $this->venuesRepository->findByNameWithinMapped($job, $row['Hall']); + if (is_null($venue)) { + // Nope, can't find it, so ask the user what to do + $mappings = $this->mappingService->findVenueMappings($row['Hall']); + $status->setUnknown(UploadJobStatus::UNKNOWN_VENUE, $mappings); + + $allLinesProcessed = false; + $isValid = false; + } + } + + // Is something is not valid stop the process + if (!$isValid) { + break; + } else { + /** @var Fixture $fixture */ + $fixture = new Fixture(); + $fixture + ->setDivision($division->getId()) + ->setMatchNumber($row['Match']) + ->setMatchDate(Carbon::createFromFormat('d/m/Y', $row['Date'])) + ->setWarmUpTime(Carbon::createFromFormat('H:i:s', $row['WUTime'])) + ->setStartTime(Carbon::createFromFormat('H:i:s', $row['StartTime'])) + ->setHomeTeam($homeTeam->getId()) + ->setAwayTeam($awayTeam->getId()) + ->setVenue($venue->getId()); + + $this->uploadDataService->add($job->getId(), Fixture::class, $fixture); + + unset($fixture); + } + + // Update the line counter + $status->setProcessedLines(++$processedLines); + $job->setStatus($status->toArray())->save(); + } + fclose($csvFile); + + // If we exited the loop because we have processed all the lines then advance to the next stage + if ($allLinesProcessed) { + $status->moveForward()->setTotalRows(UploadJobData::findByJobId($job->getId())->count()); + } + + // Whether we stop because of an error or because we're finished validating, save the status + $job->setStatus($status->toArray())->save(); + } + + if ($status->isInserting()) { + /** @var Collection $rows */ + $rows = $this->uploadDataService->getUnprocessed($job->getId()); + + // Pass 1: + // Run all the SQL in a transaction so see if they are all valid + $valid = true; + DB::beginTransaction(); + try { + /** @var UploadJobData $row */ + foreach ($rows as $row) { + /** @var Model $model */ + $model = unserialize($row->model_data); + $model->save(); + unset($model); + } + } catch (\Exception $e) { + $valid = false; + } + DB::rollBack(); + + // Pass 2: + // If all SQL is valid run them updating the status and progress + if (!$valid) { + $status->setInsertingError($e->getMessage()); + $job->setStatus($status->toArray())->save(); + } else { + $processedRows = 0; + /** @var UploadJobData $row */ + foreach ($rows as $row) { + /** @var Model $model */ + $model = unserialize($row->model_data); + $model->save(); + unset($model); + + // Update the row counter + $status->setProcessedRows(++$processedRows); + $job->setStatus($status->toArray())->save(); + } + + $status->moveForward(); + $job->setStatus($status->toArray())->save(); + } + } + + if ($status->isDone()) { + $this->cleanUp($job); + } + } + + /** + * @param UploadJob $job + */ + public function cleanUp(UploadJob $job) + { + $job->mappedTeams()->delete(); + $job->mappedVenues()->delete(); + $job->uploadData()->delete(); + unlink(storage_path() . self::UPLOAD_DIR . $job->getId() . '.csv'); + if (!UploadJobStatus::factory($job->getStatus())->isDone()) { + $job->delete(); + } + } + + /******************* + * PRIVATE METHODS * + *******************/ + + /** + * @param resource $file + * @param int $numberOfLines + */ + private function getIntoPosition(&$file, $numberOfLines) + { + $counter = 0; + while ($counter < $numberOfLines && !feof($file)) { + fgets($file); + $counter++; + } + } +} \ No newline at end of file diff --git a/app/Services/MappingService.php b/app/Services/MappingService.php new file mode 100644 index 00000000..e05eaf99 --- /dev/null +++ b/app/Services/MappingService.php @@ -0,0 +1,52 @@ +get() as $team) { + $mappings[] = [ + 'value' => $team->id, + 'text' => $team->team, + ]; + } + + return $mappings; + } + + /** + * @param string $venue + * + * @return array + */ + public function findVenueMappings($venue) + { + $mappings = []; + foreach (Venue::orderBy('venue', 'asc')->get() as $venue) { + $mappings[] = [ + 'value' => $venue->id, + 'text' => $venue->venue, + ]; + } + + return $mappings; + } +} \ No newline at end of file diff --git a/app/Services/UploadDataService.php b/app/Services/UploadDataService.php new file mode 100644 index 00000000..4cae723b --- /dev/null +++ b/app/Services/UploadDataService.php @@ -0,0 +1,47 @@ + + * Date: 05/02/2017 + * Time: 17:02 + */ + +namespace LVA\Services; + +use Illuminate\Database\Eloquent\Collection; +use LVA\Models\UploadJob; +use LVA\Models\UploadJobData; +use Illuminate\Database\Eloquent\Model; + +class UploadDataService +{ + /** + * @param int $jobId + * @param string $modelClass + * @param Model $model + */ + public function add($jobId, $modelClass, Model $model) + { + $jobData = new UploadJobData(); + + $jobData + ->setJob($jobId) + ->setModel($modelClass) + ->setData(serialize($model)) + ->save(); + } + + /** + * @param int $jobId + * @param int $processedRows + * + * @return Collection + */ + public function getUnprocessed($jobId, $processedRows = 0) + { + /** @var Collection $rows */ + $rows = UploadJobData::findByJobId($jobId); + + return $rows->slice($processedRows); + } +} \ No newline at end of file diff --git a/app/User.php b/app/User.php index 5fe3cafa..28c5af81 100644 --- a/app/User.php +++ b/app/User.php @@ -1,27 +1,12 @@ + * Date: 11/09/2016 + * Time: 12:49 + */ + +namespace LVA\Validators; + +use LVA\Services\InteractiveFixturesUploadService; +use Illuminate\Http\UploadedFile; + +class CustomValidators +{ + public function requiredHeaders($attribute, $value, $parameters, $validator) + { + if ($value instanceof UploadedFile) { + $handle = fopen($value->getRealPath(), 'r'); + $headers = InteractiveFixturesUploadService::readOneLine($handle); + + if ($parameters == array_intersect($parameters, $headers)) { + return true; + } + } + + return false; + } + + public function requiredHeadersMessage($message, $attribute, $rule, $parameters) + { + $lastHeader = '"' . array_pop($parameters) . '"'; + if (empty($parameters)) { + $headers = $lastHeader; + } else { + $headers = '"' . implode('", "', $parameters) . '" and ' . $lastHeader; + } + + return str_replace(':headers', $headers, $message); + } +} \ No newline at end of file diff --git a/bootstrap/app.php b/bootstrap/app.php index f2801adf..34e187ff 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -28,17 +28,17 @@ $app->singleton( Illuminate\Contracts\Http\Kernel::class, - App\Http\Kernel::class + LVA\Http\Kernel::class ); $app->singleton( Illuminate\Contracts\Console\Kernel::class, - App\Console\Kernel::class + LVA\Console\Kernel::class ); $app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, - App\Exceptions\Handler::class + LVA\Exceptions\Handler::class ); /* diff --git a/composer.json b/composer.json index 436d6b94..71558113 100644 --- a/composer.json +++ b/composer.json @@ -5,13 +5,17 @@ "license": "MIT", "authors": [ { - "name": "Giulio Troccoli ", + "name": "Giulio Troccoli-Allard", "email": "giulio@troccoli.it" } ], "keywords": [ "framework", - "laravel" + "laravel", + "volleyball", + "referee", + "admin", + "london" ], "type": "project", "require": { @@ -36,7 +40,7 @@ "database" ], "psr-4": { - "App\\": "app/" + "LVA\\": "app/" } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index f849bae3..97477a27 100644 --- a/composer.lock +++ b/composer.lock @@ -4,25 +4,24 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "5d1223f27a2378ce72fe0a6cf29e26a6", "content-hash": "1e1a72b5a999e3b23204b8f7039882e0", "packages": [ { "name": "classpreloader/classpreloader", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/ClassPreloader/ClassPreloader.git", - "reference": "9b10b913c2bdf90c3d2e0d726b454fb7f77c552a" + "reference": "bc7206aa892b5a33f4680421b69b191efd32b096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/9b10b913c2bdf90c3d2e0d726b454fb7f77c552a", - "reference": "9b10b913c2bdf90c3d2e0d726b454fb7f77c552a", + "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/bc7206aa892b5a33f4680421b69b191efd32b096", + "reference": "bc7206aa892b5a33f4680421b69b191efd32b096", "shasum": "" }, "require": { - "nikic/php-parser": "^1.0|^2.0", + "nikic/php-parser": "^1.0|^2.0|^3.0", "php": ">=5.5.9" }, "require-dev": { @@ -31,7 +30,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -59,20 +58,20 @@ "class", "preload" ], - "time": "2015-11-09 22:51:51" + "time": "2016-09-16T12:50:15+00:00" }, { "name": "davejamesmiller/laravel-breadcrumbs", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/davejamesmiller/laravel-breadcrumbs.git", - "reference": "5a5d5d1b1f5780359604f7fde11bbf810ff3e9e4" + "reference": "6ca5a600003ecb52a5b5af14dad82033058604e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/davejamesmiller/laravel-breadcrumbs/zipball/5a5d5d1b1f5780359604f7fde11bbf810ff3e9e4", - "reference": "5a5d5d1b1f5780359604f7fde11bbf810ff3e9e4", + "url": "https://api.github.com/repos/davejamesmiller/laravel-breadcrumbs/zipball/6ca5a600003ecb52a5b5af14dad82033058604e1", + "reference": "6ca5a600003ecb52a5b5af14dad82033058604e1", "shasum": "" }, "require": { @@ -82,7 +81,7 @@ }, "require-dev": { "mockery/mockery": "0.9.*", - "orchestra/testbench": "3.0.*", + "orchestra/testbench": "3.2.*|3.3.*", "phpunit/phpunit": "4.*", "satooshi/php-coveralls": "0.6.*" }, @@ -100,15 +99,15 @@ { "name": "Dave James Miller", "email": "dave@davejamesmiller.com", - "homepage": "http://davejamesmiller.com/" + "homepage": "https://davejamesmiller.com/" } ], "description": "A simple Laravel-style way to create breadcrumbs in Laravel 4+.", - "homepage": "https://github.com/davejamesmiller/laravel-breadcrumbs", + "homepage": "https://laravel-breadcrumbs.readthedocs.io/", "keywords": [ "laravel" ], - "time": "2015-02-08 21:44:39" + "time": "2017-01-30T21:16:53+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -141,7 +140,7 @@ "MIT" ], "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24 07:27:01" + "time": "2014-10-24T07:27:01+00:00" }, { "name": "doctrine/inflector", @@ -208,7 +207,7 @@ "singularize", "string" ], - "time": "2015-11-06 14:35:42" + "time": "2015-11-06T14:35:42+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -251,7 +250,7 @@ "homepage": "http://www.acci.cz" } ], - "time": "2014-04-08 15:00:19" + "time": "2014-04-08T15:00:19+00:00" }, { "name": "jakub-onderka/php-console-highlighter", @@ -295,24 +294,24 @@ "homepage": "http://www.acci.cz/" } ], - "time": "2015-04-20 18:58:01" + "time": "2015-04-20T18:58:01+00:00" }, { "name": "jeremeamia/SuperClosure", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/jeremeamia/super_closure.git", - "reference": "29a88be2a4846d27c1613aed0c9071dfad7b5938" + "reference": "443c3df3207f176a1b41576ee2a66968a507b3db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/29a88be2a4846d27c1613aed0c9071dfad7b5938", - "reference": "29a88be2a4846d27c1613aed0c9071dfad7b5938", + "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/443c3df3207f176a1b41576ee2a66968a507b3db", + "reference": "443c3df3207f176a1b41576ee2a66968a507b3db", "shasum": "" }, "require": { - "nikic/php-parser": "^1.2|^2.0", + "nikic/php-parser": "^1.2|^2.0|^3.0", "php": ">=5.4", "symfony/polyfill-php56": "^1.0" }, @@ -322,7 +321,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -353,20 +352,20 @@ "serialize", "tokenizer" ], - "time": "2015-12-05 17:17:57" + "time": "2016-12-07T09:37:55+00:00" }, { "name": "laracasts/flash", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/laracasts/flash.git", - "reference": "4df7200127a71511bdf116bc8b7a2586612c7a35" + "reference": "03eec812fd6ae948664ff51b4320785f6d15ee5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laracasts/flash/zipball/4df7200127a71511bdf116bc8b7a2586612c7a35", - "reference": "4df7200127a71511bdf116bc8b7a2586612c7a35", + "url": "https://api.github.com/repos/laracasts/flash/zipball/03eec812fd6ae948664ff51b4320785f6d15ee5d", + "reference": "03eec812fd6ae948664ff51b4320785f6d15ee5d", "shasum": "" }, "require": { @@ -396,20 +395,20 @@ } ], "description": "Easy flash notifications", - "time": "2016-03-14 15:55:34" + "time": "2016-07-11T20:46:02+00:00" }, { "name": "laravel/framework", - "version": "v5.2.31", + "version": "v5.2.45", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "2fa2797604bf54b06faf7bb139a9fc0d66826fea" + "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/2fa2797604bf54b06faf7bb139a9fc0d66826fea", - "reference": "2fa2797604bf54b06faf7bb139a9fc0d66826fea", + "url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1", + "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1", "shasum": "" }, "require": { @@ -466,7 +465,8 @@ "illuminate/support": "self.version", "illuminate/translation": "self.version", "illuminate/validation": "self.version", - "illuminate/view": "self.version" + "illuminate/view": "self.version", + "tightenco/collect": "self.version" }, "require-dev": { "aws/aws-sdk-php": "~3.0", @@ -489,7 +489,7 @@ "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", "symfony/css-selector": "Required to use some of the crawler integration testing tools (2.8.*|3.0.*).", "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*).", - "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." + "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)." }, "type": "library", "extra": { @@ -525,20 +525,20 @@ "framework", "laravel" ], - "time": "2016-04-27 13:02:09" + "time": "2016-08-26T11:44:52+00:00" }, { "name": "laravelcollective/html", - "version": "v5.2.4", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/LaravelCollective/html.git", - "reference": "3a312d39ffe37da0f57b602618b61fd07c1fcec5" + "reference": "8956f004753d7b1bc793076f6adfb678e31d1250" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/3a312d39ffe37da0f57b602618b61fd07c1fcec5", - "reference": "3a312d39ffe37da0f57b602618b61fd07c1fcec5", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/8956f004753d7b1bc793076f6adfb678e31d1250", + "reference": "8956f004753d7b1bc793076f6adfb678e31d1250", "shasum": "" }, "require": { @@ -579,24 +579,24 @@ ], "description": "HTML and Form Builders for the Laravel Framework", "homepage": "http://laravelcollective.com", - "time": "2016-01-27 22:29:54" + "time": "2016-12-13T14:28:46+00:00" }, { "name": "league/flysystem", - "version": "1.0.22", + "version": "1.0.35", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "bd73a91703969a2d20ab4bfbf971d6c2cbe36612" + "reference": "dda7f3ab94158a002d9846a97dc18ebfb7acc062" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/bd73a91703969a2d20ab4bfbf971d6c2cbe36612", - "reference": "bd73a91703969a2d20ab4bfbf971d6c2cbe36612", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/dda7f3ab94158a002d9846a97dc18ebfb7acc062", + "reference": "dda7f3ab94158a002d9846a97dc18ebfb7acc062", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.5.9" }, "conflict": { "league/flysystem-sftp": "<1.0.6" @@ -605,7 +605,7 @@ "ext-fileinfo": "*", "mockery/mockery": "~0.9", "phpspec/phpspec": "^2.2", - "phpunit/phpunit": "~4.8 || ~5.0" + "phpunit/phpunit": "~4.8" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -662,20 +662,20 @@ "sftp", "storage" ], - "time": "2016-04-28 06:53:12" + "time": "2017-02-09T11:33:58+00:00" }, { "name": "monolog/monolog", - "version": "1.19.0", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf" + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf", - "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0", + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0", "shasum": "" }, "require": { @@ -686,7 +686,7 @@ "psr/log-implementation": "1.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9", + "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", "jakub-onderka/php-parallel-lint": "0.9", @@ -694,8 +694,8 @@ "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "~5.3" }, "suggest": { @@ -707,9 +707,9 @@ "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", "php-console/php-console": "Allow sending log messages to Google Chrome", - "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "extra": { @@ -740,20 +740,20 @@ "logging", "psr-3" ], - "time": "2016-04-12 18:29:35" + "time": "2017-03-13T07:08:03+00:00" }, { "name": "mtdowling/cron-expression", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/mtdowling/cron-expression.git", - "reference": "c9ee7886f5a12902b225a1a12f36bb45f9ab89e5" + "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/c9ee7886f5a12902b225a1a12f36bb45f9ab89e5", - "reference": "c9ee7886f5a12902b225a1a12f36bb45f9ab89e5", + "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad", + "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", "shasum": "" }, "require": { @@ -764,8 +764,8 @@ }, "type": "library", "autoload": { - "psr-0": { - "Cron": "src/" + "psr-4": { + "Cron\\": "src/Cron/" } }, "notification-url": "https://packagist.org/downloads/", @@ -784,30 +784,36 @@ "cron", "schedule" ], - "time": "2016-01-26 21:23:30" + "time": "2017-01-23T04:29:33+00:00" }, { "name": "nesbot/carbon", - "version": "1.21.0", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "7b08ec6f75791e130012f206e3f7b0e76e18e3d7" + "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7b08ec6f75791e130012f206e3f7b0e76e18e3d7", - "reference": "7b08ec6f75791e130012f206e3f7b0e76e18e3d7", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", + "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", "shasum": "" }, "require": { "php": ">=5.3.0", - "symfony/translation": "~2.6|~3.0" + "symfony/translation": "~2.6 || ~3.0" }, "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "~4.0 || ~5.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.23-dev" + } + }, "autoload": { "psr-4": { "Carbon\\": "src/Carbon/" @@ -831,20 +837,20 @@ "datetime", "time" ], - "time": "2015-11-04 20:07:17" + "time": "2017-01-16T07:55:07+00:00" }, { "name": "nikic/php-parser", - "version": "v2.1.0", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3" + "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/47b254ea51f1d6d5dc04b9b299e88346bf2369e3", - "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0", + "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0", "shasum": "" }, "require": { @@ -882,20 +888,20 @@ "parser", "php" ], - "time": "2016-04-19 13:41:41" + "time": "2016-09-16T12:04:44+00:00" }, { "name": "paragonie/random_compat", - "version": "v1.4.1", + "version": "v1.4.2", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "c7e26a21ba357863de030f0b9e701c7d04593774" + "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/c7e26a21ba357863de030f0b9e701c7d04593774", - "reference": "c7e26a21ba357863de030f0b9e701c7d04593774", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/965cdeb01fdcab7653253aa81d40441d261f1e66", + "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66", "shasum": "" }, "require": { @@ -930,26 +936,34 @@ "pseudorandom", "random" ], - "time": "2016-03-18 20:34:03" + "time": "2017-03-13T16:22:52+00:00" }, { "name": "psr/log", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -963,12 +977,13 @@ } ], "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2012-12-21 11:40:51" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "psy/psysh", @@ -1040,27 +1055,28 @@ "interactive", "shell" ], - "time": "2016-03-09 05:03:14" + "time": "2016-03-09T05:03:14+00:00" }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.1", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" + "reference": "81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e", + "reference": "81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1,<0.9.4" + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" }, "type": "library", "extra": { @@ -1093,20 +1109,20 @@ "mail", "mailer" ], - "time": "2015-06-06 14:19:39" + "time": "2017-02-13T07:52:53+00:00" }, { "name": "symfony/console", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd" + "reference": "926061e74229e935d3c5b4e9ba87237316c6693f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6b1175135bc2a74c08a28d89761272de8beed8cd", - "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd", + "url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f", + "reference": "926061e74229e935d3c5b4e9ba87237316c6693f", "shasum": "" }, "require": { @@ -1153,20 +1169,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-03-16 17:00:50" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/debug", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "a06d10888a45afd97534506afb058ec38d9ba35b" + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/a06d10888a45afd97534506afb058ec38d9ba35b", - "reference": "a06d10888a45afd97534506afb058ec38d9ba35b", + "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", "shasum": "" }, "require": { @@ -1210,20 +1226,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.0.4", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39" + "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9002dcf018d884d294b1ef20a6f968efc1128f39", - "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", + "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", "shasum": "" }, "require": { @@ -1243,7 +1259,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1270,20 +1286,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-03-10 10:34:12" + "time": "2017-02-21T09:12:04+00:00" }, { "name": "symfony/finder", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c54e407b35bc098916704e9fd090da21da4c4f52" + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52", - "reference": "c54e407b35bc098916704e9fd090da21da4c4f52", + "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "shasum": "" }, "require": { @@ -1319,20 +1335,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-03-10 11:13:05" + "time": "2016-06-29T05:40:00+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "99f38445a874e7becb8afc4b4a79ee181cf6ec3f" + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/99f38445a874e7becb8afc4b4a79ee181cf6ec3f", - "reference": "99f38445a874e7becb8afc4b4a79ee181cf6ec3f", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82", + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82", "shasum": "" }, "require": { @@ -1372,20 +1388,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-03-27 14:50:32" + "time": "2016-07-17T13:54:30+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "579f828489659d7b3430f4bd9b67b4618b387dea" + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/579f828489659d7b3430f4bd9b67b4618b387dea", - "reference": "579f828489659d7b3430f4bd9b67b4618b387dea", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3", + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3", "shasum": "" }, "require": { @@ -1393,7 +1409,7 @@ "psr/log": "~1.0", "symfony/debug": "~2.8|~3.0", "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0" + "symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2" }, "conflict": { "symfony/config": "<2.8" @@ -1454,20 +1470,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-03-25 01:41:20" + "time": "2016-07-30T09:10:37+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.1.1", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "1289d16209491b584839022f29257ad859b8532d" + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", - "reference": "1289d16209491b584839022f29257ad859b8532d", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", "shasum": "" }, "require": { @@ -1479,7 +1495,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1513,20 +1529,20 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/polyfill-php56", - "version": "v1.1.1", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9" + "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/4d891fff050101a53a4caabb03277284942d1ad9", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/1dd42b9b89556f18092f3d1ada22cb05ac85383c", + "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c", "shasum": "" }, "require": { @@ -1536,7 +1552,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1569,20 +1585,20 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/polyfill-util", - "version": "v1.1.1", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4" + "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/746bce0fca664ac0a575e465f65c6643faddf7fb", + "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb", "shasum": "" }, "require": { @@ -1591,7 +1607,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1621,20 +1637,20 @@ "polyfill", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/process", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776" + "reference": "768debc5996f599c4372b322d9061dba2a4bf505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e6f1f98bbd355d209a992bfff45e7edfbd4a0776", - "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776", + "url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505", + "reference": "768debc5996f599c4372b322d9061dba2a4bf505", "shasum": "" }, "require": { @@ -1670,20 +1686,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-07-28T11:13:34+00:00" }, { "name": "symfony/routing", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "d061b609f2d0769494c381ec92f5c5cc5e4a20aa" + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/d061b609f2d0769494c381ec92f5c5cc5e4a20aa", - "reference": "d061b609f2d0769494c381ec92f5c5cc5e4a20aa", + "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "shasum": "" }, "require": { @@ -1745,20 +1761,20 @@ "uri", "url" ], - "time": "2016-03-23 13:23:25" + "time": "2016-06-29T05:40:00+00:00" }, { "name": "symfony/translation", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f7a07af51ea067745a521dab1e3152044a2fb1f2" + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f7a07af51ea067745a521dab1e3152044a2fb1f2", - "reference": "f7a07af51ea067745a521dab1e3152044a2fb1f2", + "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", "shasum": "" }, "require": { @@ -1809,20 +1825,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2016-03-25 01:41:20" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3841ed86527d18ee2c35fe4afb1b2fc60f8fae79" + "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3841ed86527d18ee2c35fe4afb1b2fc60f8fae79", - "reference": "3841ed86527d18ee2c35fe4afb1b2fc60f8fae79", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377", + "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377", "shasum": "" }, "require": { @@ -1872,20 +1888,20 @@ "debug", "dump" ], - "time": "2016-03-10 10:34:12" + "time": "2016-07-26T08:03:56+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v2.2.1", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "63f37b9395e8041cd4313129c08ece896d06ca8e" + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/63f37b9395e8041cd4313129c08ece896d06ca8e", - "reference": "63f37b9395e8041cd4313129c08ece896d06ca8e", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", "shasum": "" }, "require": { @@ -1897,7 +1913,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.4-dev" } }, "autoload": { @@ -1922,22 +1938,22 @@ "env", "environment" ], - "time": "2016-04-15 10:48:49" + "time": "2016-09-01T10:05:43+00:00" } ], "packages-dev": [ { "name": "appzcoder/crud-generator", - "version": "v1.0.8", + "version": "v1.2.3", "source": { "type": "git", "url": "https://github.com/appzcoder/crud-generator.git", - "reference": "f1dee5a78f963fada17bb0d003b988e3137c4fe9" + "reference": "ab6805c276ab79d139dda24dcf58802b50fd00ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appzcoder/crud-generator/zipball/f1dee5a78f963fada17bb0d003b988e3137c4fe9", - "reference": "f1dee5a78f963fada17bb0d003b988e3137c4fe9", + "url": "https://api.github.com/repos/appzcoder/crud-generator/zipball/ab6805c276ab79d139dda24dcf58802b50fd00ae", + "reference": "ab6805c276ab79d139dda24dcf58802b50fd00ae", "shasum": "" }, "require": { @@ -1968,32 +1984,35 @@ "laravel", "laravel crud generator" ], - "time": "2016-04-26 18:29:26" + "time": "2016-09-28T18:05:53+00:00" }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.1.4", + "version": "v2.3.2", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "f1ebd847aac9a4545325d35108cafc285fe1605f" + "reference": "e82de98cef0d6597b1b686be0b5813a3a4bb53c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/f1ebd847aac9a4545325d35108cafc285fe1605f", - "reference": "f1ebd847aac9a4545325d35108cafc285fe1605f", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/e82de98cef0d6597b1b686be0b5813a3a4bb53c5", + "reference": "e82de98cef0d6597b1b686be0b5813a3a4bb53c5", "shasum": "" }, "require": { - "illuminate/console": "5.0.x|5.1.x|5.2.x", - "illuminate/filesystem": "5.0.x|5.1.x|5.2.x", - "illuminate/support": "5.0.x|5.1.x|5.2.x", + "barryvdh/reflection-docblock": "^2.0.4", + "illuminate/console": "^5.0,<5.5", + "illuminate/filesystem": "^5.0,<5.5", + "illuminate/support": "^5.0,<5.5", "php": ">=5.4.0", - "phpdocumentor/reflection-docblock": "^2.0.4", - "symfony/class-loader": "~2.3|~3.0" + "symfony/class-loader": "^2.3|^3.0" }, "require-dev": { - "doctrine/dbal": "~2.3" + "doctrine/dbal": "~2.3", + "phpunit/phpunit": "4.*", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" }, "suggest": { "doctrine/dbal": "Load information from the database about models for phpdocs (~2.3)" @@ -2001,7 +2020,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -2031,39 +2050,88 @@ "phpstorm", "sublime" ], - "time": "2016-03-03 08:45:00" + "time": "2017-02-22T12:27:33+00:00" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "3dcbd98b5d9384a5357266efba8fd29884458e5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/3dcbd98b5d9384a5357266efba8fd29884458e5c", + "reference": "3dcbd98b5d9384a5357266efba8fd29884458e5c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0,<4.5" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-06-13T19:28:20+00:00" }, { "name": "doctrine/annotations", - "version": "v1.2.7", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": ">=5.3.2" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", @@ -2099,20 +2167,20 @@ "docblock", "parser" ], - "time": "2015-08-31 12:32:49" + "time": "2017-02-24T16:22:25+00:00" }, { "name": "doctrine/cache", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6" + "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/f8af318d14bdb0eff0336795b428b547bd39ccb6", - "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6", + "url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3", + "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3", "shasum": "" }, "require": { @@ -2169,32 +2237,33 @@ "cache", "caching" ], - "time": "2015-12-31 16:37:02" + "time": "2016-10-29T11:16:17+00:00" }, { "name": "doctrine/collections", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2235,20 +2304,20 @@ "collections", "iterator" ], - "time": "2015-04-14 22:21:58" + "time": "2017-01-03T10:49:41+00:00" }, { "name": "doctrine/common", - "version": "v2.6.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "a579557bc689580c19fee4e27487a67fe60defc0" + "reference": "930297026c8009a567ac051fd545bf6124150347" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/a579557bc689580c19fee4e27487a67fe60defc0", - "reference": "a579557bc689580c19fee4e27487a67fe60defc0", + "url": "https://api.github.com/repos/doctrine/common/zipball/930297026c8009a567ac051fd545bf6124150347", + "reference": "930297026c8009a567ac051fd545bf6124150347", "shasum": "" }, "require": { @@ -2257,10 +2326,10 @@ "doctrine/collections": "1.*", "doctrine/inflector": "1.*", "doctrine/lexer": "1.*", - "php": "~5.5|~7.0" + "php": "~5.6|~7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0" + "phpunit/phpunit": "^5.4.6" }, "type": "library", "extra": { @@ -2308,29 +2377,29 @@ "persistence", "spl" ], - "time": "2015-12-25 13:18:31" + "time": "2017-01-13T14:02:13+00:00" }, { "name": "doctrine/dbal", - "version": "v2.5.4", + "version": "v2.5.12", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769" + "reference": "7b9e911f9d8b30d43b96853dab26898c710d8f44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/abbdfd1cff43a7b99d027af3be709bc8fc7d4769", - "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/7b9e911f9d8b30d43b96853dab26898c710d8f44", + "reference": "7b9e911f9d8b30d43b96853dab26898c710d8f44", "shasum": "" }, "require": { - "doctrine/common": ">=2.4,<2.7-dev", + "doctrine/common": ">=2.4,<2.8-dev", "php": ">=5.3.2" }, "require-dev": { "phpunit/phpunit": "4.*", - "symfony/console": "2.*" + "symfony/console": "2.*||^3.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -2379,7 +2448,7 @@ "persistence", "queryobject" ], - "time": "2016-01-05 22:11:12" + "time": "2017-02-08T12:53:47+00:00" }, { "name": "doctrine/instantiator", @@ -2433,7 +2502,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "doctrine/lexer", @@ -2487,7 +2556,7 @@ "lexer", "parser" ], - "time": "2014-09-09 13:34:57" + "time": "2014-09-09T13:34:57+00:00" }, { "name": "fzaninotto/faker", @@ -2535,7 +2604,7 @@ "faker", "fixtures" ], - "time": "2016-04-29 12:21:54" + "time": "2016-04-29T12:21:54+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -2580,20 +2649,20 @@ "keywords": [ "test" ], - "time": "2015-05-11 14:41:42" + "time": "2015-05-11T14:41:42+00:00" }, { "name": "mockery/mockery", - "version": "0.9.4", + "version": "0.9.9", "source": { "type": "git", "url": "https://github.com/padraic/mockery.git", - "reference": "70bba85e4aabc9449626651f48b9018ede04f86b" + "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/70bba85e4aabc9449626651f48b9018ede04f86b", - "reference": "70bba85e4aabc9449626651f48b9018ede04f86b", + "url": "https://api.github.com/repos/padraic/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", + "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", "shasum": "" }, "require": { @@ -2645,20 +2714,20 @@ "test double", "testing" ], - "time": "2015-04-02 19:54:00" + "time": "2017-02-28T12:52:32+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.5.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "a8773992b362b58498eed24bf85005f363c34771" + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", - "reference": "a8773992b362b58498eed24bf85005f363c34771", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", "shasum": "" }, "require": { @@ -2687,41 +2756,138 @@ "object", "object graph" ], - "time": "2015-11-20 12:04:31" + "time": "2017-01-26T22:05:40+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30T07:12:33+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -2733,39 +2899,40 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -2798,20 +2965,20 @@ "spy", "stub" ], - "time": "2016-02-15 07:46:21" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "3.3.1", + "version": "3.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2431befdd451fac43fbcde94d1a92fb3b8b68f86" + "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2431befdd451fac43fbcde94d1a92fb3b8b68f86", - "reference": "2431befdd451fac43fbcde94d1a92fb3b8b68f86", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/44cd8e3930e431658d1a5de7d282d5cb37837fd5", + "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5", "shasum": "" }, "require": { @@ -2861,20 +3028,20 @@ "testing", "xunit" ], - "time": "2016-04-08 08:14:53" + "time": "2016-05-27T16:24:29+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { @@ -2908,7 +3075,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21 13:08:43" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -2949,26 +3116,34 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -2990,20 +3165,20 @@ "keywords": [ "timer" ], - "time": "2015-06-21 08:01:12" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { @@ -3039,7 +3214,7 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", @@ -3113,7 +3288,7 @@ "testing", "xunit" ], - "time": "2016-03-15 05:59:58" + "time": "2016-03-15T05:59:58+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -3169,27 +3344,27 @@ "mock", "xunit" ], - "time": "2016-04-20 14:39:26" + "time": "2016-04-20T14:39:26+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { @@ -3214,26 +3389,26 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13 06:45:14" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -3278,7 +3453,7 @@ "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", @@ -3330,27 +3505,27 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", - "version": "1.3.5", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -3380,20 +3555,20 @@ "environment", "hhvm" ], - "time": "2016-02-26 18:40:46" + "time": "2016-08-18T05:49:44+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -3401,12 +3576,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -3446,7 +3622,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17T09:04:28+00:00" }, { "name": "sebastian/global-state", @@ -3497,20 +3673,20 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -3550,7 +3726,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/resource-operations", @@ -3592,20 +3768,20 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { @@ -3635,20 +3811,20 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-02-04 12:56:52" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "symfony/class-loader", - "version": "v3.0.4", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877" + "reference": "c29a5bc6ca14cfff1f5e3d7781ed74b6e898d2b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877", - "reference": "cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/c29a5bc6ca14cfff1f5e3d7781ed74b6e898d2b9", + "reference": "c29a5bc6ca14cfff1f5e3d7781ed74b6e898d2b9", "shasum": "" }, "require": { @@ -3664,7 +3840,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -3691,20 +3867,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2017-02-18T17:28:00+00:00" }, { "name": "symfony/css-selector", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0" + "reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/65e764f404685f2dc20c057e889b3ad04b2e2db0", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8999c1f33c224b2b66b38253f5e3a838d0d0115", + "reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115", "shasum": "" }, "require": { @@ -3744,20 +3920,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-06-29T05:40:00+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.0.4", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f" + "reference": "dff8fecf1f56990d88058e3a1885c2a5f1b8e970" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/18a06d7a9af41718c20764a674a0ebba3bc40d1f", - "reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/dff8fecf1f56990d88058e3a1885c2a5f1b8e970", + "reference": "dff8fecf1f56990d88058e3a1885c2a5f1b8e970", "shasum": "" }, "require": { @@ -3800,29 +3976,35 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2016-03-23 13:23:25" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/yaml", - "version": "v3.0.4", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0047c8366744a16de7516622c5b7355336afae96" + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", - "reference": "0047c8366744a16de7516622c5b7355336afae96", + "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", "shasum": "" }, "require": { "php": ">=5.5.9" }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -3849,7 +4031,57 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2017-03-07T16:47:02+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], diff --git a/config/app.php b/config/app.php index 26fe4597..e92fd777 100644 --- a/config/app.php +++ b/config/app.php @@ -39,7 +39,7 @@ | */ - 'url' => 'http://localhost', + 'url' => env('APP_URL', 'http://localhost'), /* |-------------------------------------------------------------------------- @@ -151,10 +151,10 @@ /* * Application Service Providers... */ - App\Providers\AppServiceProvider::class, - App\Providers\AuthServiceProvider::class, - App\Providers\EventServiceProvider::class, - App\Providers\RouteServiceProvider::class, + LVA\Providers\AppServiceProvider::class, + LVA\Providers\AuthServiceProvider::class, + LVA\Providers\EventServiceProvider::class, + LVA\Providers\RouteServiceProvider::class, DaveJamesMiller\Breadcrumbs\ServiceProvider::class, Collective\Html\HtmlServiceProvider::class, diff --git a/config/auth.php b/config/auth.php index 3fa7f491..c98aac4d 100644 --- a/config/auth.php +++ b/config/auth.php @@ -67,7 +67,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => LVA\User::class, ], // 'users' => [ diff --git a/config/broadcasting.php b/config/broadcasting.php index abaaac32..ff51a175 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -34,7 +34,8 @@ 'secret' => env('PUSHER_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - // + 'cluster' => 'eu', + 'encrypted' => true, ], ], diff --git a/config/mail.php b/config/mail.php index 651ebc93..2e28aaa5 100644 --- a/config/mail.php +++ b/config/mail.php @@ -54,7 +54,7 @@ | */ - 'from' => ['address' => 'giulio.volleyball@gmail.com', 'name' => 'Giulio Troccoli'], + 'from' => ['address' => 'giulio.volleyball@gmail.com', 'name' => 'Giulio Troccoli-Allard'], /* |-------------------------------------------------------------------------- diff --git a/config/services.php b/config/services.php index 93eec863..fa5ce29c 100644 --- a/config/services.php +++ b/config/services.php @@ -30,7 +30,7 @@ ], 'stripe' => [ - 'model' => App\User::class, + 'model' => LVA\User::class, 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/database/deployment/2016_09_10_163430_create_upload_jobs_table.sql b/database/deployment/2016_09_10_163430_create_upload_jobs_table.sql new file mode 100644 index 00000000..df20b910 --- /dev/null +++ b/database/deployment/2016_09_10_163430_create_upload_jobs_table.sql @@ -0,0 +1,11 @@ +CREATE TABLE `upload_jobs` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `file` VARCHAR(255) NOT NULL, + `type` ENUM ('fixtures') NOT NULL, + `status` LONGTEXT NOT NULL, + `created_at` TIMESTAMP NULL, + `updated_at` TIMESTAMP NULL +) + DEFAULT CHARACTER SET utf8 + COLLATE utf8_unicode_ci + ENGINE = InnoDB \ No newline at end of file diff --git a/database/deployment/2016_09_26_180408_add_api_token_to_users_table.sql b/database/deployment/2016_09_26_180408_add_api_token_to_users_table.sql new file mode 100644 index 00000000..256ce169 --- /dev/null +++ b/database/deployment/2016_09_26_180408_add_api_token_to_users_table.sql @@ -0,0 +1,4 @@ +ALTER TABLE `users` + ADD `api_token` VARCHAR(60) NOT NULL; +ALTER TABLE `users` + ADD UNIQUE `users_api_token_unique`(`api_token`); diff --git a/database/deployment/2016_11_20_120809_create_synonyms_tables.sql b/database/deployment/2016_11_20_120809_create_synonyms_tables.sql new file mode 100644 index 00000000..f1094baf --- /dev/null +++ b/database/deployment/2016_11_20_120809_create_synonyms_tables.sql @@ -0,0 +1,35 @@ +CREATE TABLE `venues_synonyms` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `synonym` VARCHAR(255) NOT NULL, + `venue_id` INT UNSIGNED NOT NULL, + `created_at` TIMESTAMP NULL, + `updated_at` TIMESTAMP NULL +) + DEFAULT CHARACTER SET utf8 + COLLATE utf8_unicode_ci + ENGINE = InnoDB; + +ALTER TABLE `venues_synonyms` + ADD INDEX `venues_synonyms_synonym_index`(`synonym`); +ALTER TABLE `venues_synonyms` + ADD INDEX `venues_synonyms_venue_id_index`(`venue_id`); +ALTER TABLE `venues_synonyms` + ADD CONSTRAINT `venues_synonyms_venue_id_foreign` FOREIGN KEY (`venue_id`) REFERENCES `venues` (`id`); + +CREATE TABLE `teams_synonyms` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `synonym` VARCHAR(255) NOT NULL, + `team_id` INT UNSIGNED NOT NULL, + `created_at` TIMESTAMP NULL, + `updated_at` TIMESTAMP NULL +) + DEFAULT CHARACTER SET utf8 + COLLATE utf8_unicode_ci + ENGINE = InnoDB; + +ALTER TABLE `teams_synonyms` + ADD INDEX `teams_synonyms_synonym_index`(`synonym`); +ALTER TABLE `teams_synonyms` + ADD INDEX `teams_synonyms_team_id_index`(`team_id`); +ALTER TABLE `teams_synonyms` + ADD CONSTRAINT `teams_synonyms_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`); diff --git a/database/deployment/2016_11_20_123304_create_mapped_venues_and_teams_tables.sql b/database/deployment/2016_11_20_123304_create_mapped_venues_and_teams_tables.sql new file mode 100644 index 00000000..3926264e --- /dev/null +++ b/database/deployment/2016_11_20_123304_create_mapped_venues_and_teams_tables.sql @@ -0,0 +1,37 @@ +CREATE TABLE `mapped_venues` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `upload_job_id` INT UNSIGNED NOT NULL, + `venue` VARCHAR(255) NOT NULL, + `venue_id` INT UNSIGNED NOT NULL, + `created_at` TIMESTAMP NULL, + `updated_at` TIMESTAMP NULL +) + DEFAULT CHARACTER SET utf8 + COLLATE utf8_unicode_ci + ENGINE = InnoDB; + +ALTER TABLE `mapped_venues` + ADD INDEX `mapped_venues_venue_index`(`venue`); +ALTER TABLE `mapped_venues` + ADD CONSTRAINT `mapped_venues_upload_job_id_foreign` FOREIGN KEY (`upload_job_id`) REFERENCES `upload_jobs` (`id`); +ALTER TABLE `mapped_venues` + ADD CONSTRAINT `mapped_venues_venue_id_foreign` FOREIGN KEY (`venue_id`) REFERENCES `venues` (`id`); + +CREATE TABLE `mapped_teams` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `upload_job_id` INT UNSIGNED NOT NULL, + `team` VARCHAR(255) NOT NULL, + `team_id` INT UNSIGNED NOT NULL, + `created_at` TIMESTAMP NULL, + `updated_at` TIMESTAMP NULL +) + DEFAULT CHARACTER SET utf8 + COLLATE utf8_unicode_ci + ENGINE = InnoDB; + +ALTER TABLE `mapped_teams` + ADD INDEX `mapped_teams_team_index`(`team`); +ALTER TABLE `mapped_teams` + ADD CONSTRAINT `mapped_teams_upload_job_id_foreign` FOREIGN KEY (`upload_job_id`) REFERENCES `upload_jobs` (`id`); +ALTER TABLE `mapped_teams` + ADD CONSTRAINT `mapped_teams_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`); diff --git a/database/deployment/2016_11_20_152523_create_upload_jobs_data_table.sql b/database/deployment/2016_11_20_152523_create_upload_jobs_data_table.sql new file mode 100644 index 00000000..1d826c69 --- /dev/null +++ b/database/deployment/2016_11_20_152523_create_upload_jobs_data_table.sql @@ -0,0 +1,14 @@ +CREATE TABLE `upload_jobs_data` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `upload_job_id` INT UNSIGNED NOT NULL, + `model` VARCHAR(255) NOT NULL, + `model_data` TEXT NOT NULL, + `created_at` TIMESTAMP NULL, + `updated_at` TIMESTAMP NULL +) + DEFAULT CHARACTER SET utf8 + COLLATE utf8_unicode_ci + ENGINE = InnoDB; + +ALTER TABLE `upload_jobs_data` + ADD CONSTRAINT `upload_jobs_data_upload_job_id_foreign` FOREIGN KEY (`upload_job_id`) REFERENCES `upload_jobs` (`id`); \ No newline at end of file diff --git a/database/deployment/2017_01_21_173202_add_index_for_team_table.sql b/database/deployment/2017_01_21_173202_add_index_for_team_table.sql new file mode 100644 index 00000000..f2c4fffd --- /dev/null +++ b/database/deployment/2017_01_21_173202_add_index_for_team_table.sql @@ -0,0 +1,2 @@ +ALTER TABLE `teams` + ADD INDEX `teams_team_index`(`team`); \ No newline at end of file diff --git a/database/deployment/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.sql b/database/deployment/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.sql new file mode 100644 index 00000000..5780ed4b --- /dev/null +++ b/database/deployment/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.sql @@ -0,0 +1,2 @@ +ALTER TABLE `upload_jobs` + ADD `row_count` INT UNSIGNED NULL; \ No newline at end of file diff --git a/database/deployment/2017_02_06_113853_add_season_field_to_upload_jobs_table.sql b/database/deployment/2017_02_06_113853_add_season_field_to_upload_jobs_table.sql new file mode 100644 index 00000000..20d250dd --- /dev/null +++ b/database/deployment/2017_02_06_113853_add_season_field_to_upload_jobs_table.sql @@ -0,0 +1,4 @@ +ALTER TABLE `upload_jobs` + ADD `season_id` INT UNSIGNED NOT NULL; +ALTER TABLE `upload_jobs` + ADD CONSTRAINT `upload_jobs_season_id_foreign` FOREIGN KEY (`season_id`) REFERENCES `seasons` (`id`); \ No newline at end of file diff --git a/database/deployment/2017_02_07_165431_rename_team_field_in_mapped_teams_name.sql b/database/deployment/2017_02_07_165431_rename_team_field_in_mapped_teams_name.sql new file mode 100644 index 00000000..ab29457e --- /dev/null +++ b/database/deployment/2017_02_07_165431_rename_team_field_in_mapped_teams_name.sql @@ -0,0 +1,6 @@ +ALTER TABLE `mapped_teams` + DROP INDEX `mapped_teams_team_index`; +ALTER TABLE mapped_teams + CHANGE team mapped_team VARCHAR(255) NOT NULL; +ALTER TABLE `mapped_teams` + ADD INDEX `mapped_teams_mapped_team_index`(`mapped_team`); diff --git a/database/deployment/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.sql b/database/deployment/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.sql new file mode 100644 index 00000000..b6e30e34 --- /dev/null +++ b/database/deployment/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.sql @@ -0,0 +1,6 @@ +ALTER TABLE `mapped_venues` + DROP INDEX `mapped_venues_venue_index`; +ALTER TABLE mapped_venues + CHANGE venue mapped_venue VARCHAR(255) NOT NULL; +ALTER TABLE `mapped_venues` + ADD INDEX `mapped_venues_mapped_venue_index`(`mapped_venue`); diff --git a/database/deployment/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.sql b/database/deployment/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.sql new file mode 100644 index 00000000..64e2df09 --- /dev/null +++ b/database/deployment/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.sql @@ -0,0 +1,8 @@ +ALTER TABLE `teams_synonyms` + DROP INDEX `teams_synonyms_synonym_index`; +ALTER TABLE `teams_synonyms` + ADD UNIQUE `teams_synonyms_synonym_unique`(`synonym`); +ALTER TABLE `venues_synonyms` + DROP INDEX `venues_synonyms_synonym_index`; +ALTER TABLE `venues_synonyms` + ADD UNIQUE `venues_synonyms_synonym_unique`(`synonym`); diff --git a/database/deployment/rollbacks/2016_09_10_163430_create_upload_jobs_table.sql b/database/deployment/rollbacks/2016_09_10_163430_create_upload_jobs_table.sql new file mode 100644 index 00000000..b94b94fd --- /dev/null +++ b/database/deployment/rollbacks/2016_09_10_163430_create_upload_jobs_table.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `upload_jobs`; \ No newline at end of file diff --git a/database/deployment/rollbacks/2016_09_26_180408_add_api_token_to_users_table.sql b/database/deployment/rollbacks/2016_09_26_180408_add_api_token_to_users_table.sql new file mode 100644 index 00000000..957f05c1 --- /dev/null +++ b/database/deployment/rollbacks/2016_09_26_180408_add_api_token_to_users_table.sql @@ -0,0 +1,4 @@ +ALTER TABLE `users` + DROP INDEX `users_api_token_unique`; +ALTER TABLE `users` + DROP `api_token`; \ No newline at end of file diff --git a/database/deployment/rollbacks/2016_11_20_120809_create_synonyms_tables.sql b/database/deployment/rollbacks/2016_11_20_120809_create_synonyms_tables.sql new file mode 100644 index 00000000..c6217894 --- /dev/null +++ b/database/deployment/rollbacks/2016_11_20_120809_create_synonyms_tables.sql @@ -0,0 +1,7 @@ +ALTER TABLE `venues_synonyms` + DROP FOREIGN KEY `venues_synonyms_venue_id_foreign`; +DROP TABLE `venues_synonyms`; + +ALTER TABLE `teams_synonyms` + DROP FOREIGN KEY `teams_synonyms_team_id_foreign`; +DROP TABLE `teams_synonyms`; \ No newline at end of file diff --git a/database/deployment/rollbacks/2016_11_20_123304_create_mapped_venues_and_teams_tables.sql b/database/deployment/rollbacks/2016_11_20_123304_create_mapped_venues_and_teams_tables.sql new file mode 100644 index 00000000..17cf3913 --- /dev/null +++ b/database/deployment/rollbacks/2016_11_20_123304_create_mapped_venues_and_teams_tables.sql @@ -0,0 +1,11 @@ +ALTER TABLE `mapped_venues` + DROP FOREIGN KEY `mapped_venues_upload_job_id_foreign`; +ALTER TABLE `mapped_venues` + DROP FOREIGN KEY `mapped_venues_venue_id_foreign`; +DROP TABLE `mapped_venues`; + +ALTER TABLE `mapped_teams` + DROP FOREIGN KEY `mapped_teams_upload_job_id_foreign`; +ALTER TABLE `mapped_teams` + DROP FOREIGN KEY `mapped_teams_team_id_foreign`; +DROP TABLE `mapped_teams`; diff --git a/database/deployment/rollbacks/2016_11_20_152523_create_upload_jobs_data_table.sql b/database/deployment/rollbacks/2016_11_20_152523_create_upload_jobs_data_table.sql new file mode 100644 index 00000000..34c9b4c8 --- /dev/null +++ b/database/deployment/rollbacks/2016_11_20_152523_create_upload_jobs_data_table.sql @@ -0,0 +1,4 @@ +ALTER TABLE `upload_jobs_data` + DROP FOREIGN KEY `upload_jobs_data_upload_job_id_foreign`; + +DROP TABLE `upload_jobs_data`; \ No newline at end of file diff --git a/database/deployment/rollbacks/2017_01_21_173202_add_index_for_team_table.sql b/database/deployment/rollbacks/2017_01_21_173202_add_index_for_team_table.sql new file mode 100644 index 00000000..48721510 --- /dev/null +++ b/database/deployment/rollbacks/2017_01_21_173202_add_index_for_team_table.sql @@ -0,0 +1,2 @@ +ALTER TABLE `teams` + DROP INDEX `teams_team_index`; \ No newline at end of file diff --git a/database/deployment/rollbacks/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.sql b/database/deployment/rollbacks/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.sql new file mode 100644 index 00000000..027157fe --- /dev/null +++ b/database/deployment/rollbacks/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.sql @@ -0,0 +1,2 @@ +ALTER TABLE `upload_jobs` + DROP `row_count`; \ No newline at end of file diff --git a/database/deployment/rollbacks/2017_02_06_113853_add_season_field_to_upload_jobs_table.sql b/database/deployment/rollbacks/2017_02_06_113853_add_season_field_to_upload_jobs_table.sql new file mode 100644 index 00000000..38b76edb --- /dev/null +++ b/database/deployment/rollbacks/2017_02_06_113853_add_season_field_to_upload_jobs_table.sql @@ -0,0 +1,4 @@ +ALTER TABLE `upload_jobs` + DROP FOREIGN KEY `upload_jobs_season_id_foreign`; +ALTER TABLE `upload_jobs` + DROP `season_id`; \ No newline at end of file diff --git a/database/deployment/rollbacks/2017_02_07_165431_rename_team_field_in_mapped_teams_name.sql b/database/deployment/rollbacks/2017_02_07_165431_rename_team_field_in_mapped_teams_name.sql new file mode 100644 index 00000000..bc9c64f9 --- /dev/null +++ b/database/deployment/rollbacks/2017_02_07_165431_rename_team_field_in_mapped_teams_name.sql @@ -0,0 +1,6 @@ +ALTER TABLE `mapped_teams` + DROP INDEX `mapped_teams_mapped_team_index`; +ALTER TABLE mapped_teams + CHANGE mapped_team team VARCHAR(255) NOT NULL; +ALTER TABLE `mapped_teams` + ADD INDEX `mapped_teams_team_index`(`team`); diff --git a/database/deployment/rollbacks/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.sql b/database/deployment/rollbacks/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.sql new file mode 100644 index 00000000..c5a8b374 --- /dev/null +++ b/database/deployment/rollbacks/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.sql @@ -0,0 +1,6 @@ +ALTER TABLE `mapped_venues` + DROP INDEX `mapped_venues_mapped_venue_index`; +ALTER TABLE mapped_venues + CHANGE mapped_venue venue VARCHAR(255) NOT NULL; +ALTER TABLE `mapped_venues` + ADD INDEX `mapped_venues_venue_index`(`venue`); diff --git a/database/deployment/rollbacks/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.sql b/database/deployment/rollbacks/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.sql new file mode 100644 index 00000000..0fde1379 --- /dev/null +++ b/database/deployment/rollbacks/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.sql @@ -0,0 +1,8 @@ +ALTER TABLE `teams_synonyms` + DROP INDEX `teams_synonyms_synonym_unique`; +ALTER TABLE `teams_synonyms` + ADD INDEX `teams_synonyms_synonym_index`(`synonym`); +ALTER TABLE `venues_synonyms` + DROP INDEX `venues_synonyms_synonym_unique`; +ALTER TABLE `venues_synonyms` + ADD INDEX `venues_synonyms_synonym_index`(`synonym`); \ No newline at end of file diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index c3334a46..2197bffc 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -11,85 +11,71 @@ | */ -$factory->define(App\User::class, function (Faker\Generator $faker) { +$factory->define(\LVA\User::class, function (\Faker\Generator $faker) { return [ 'name' => $faker->unique()->name, 'email' => $faker->unique()->email, 'password' => bcrypt($faker->unique()->password()), 'remember_token' => $faker->unique()->md5, + 'api_token' => $faker->unique()->md5, ]; }); -$factory->define(\App\Models\Season::class, function (\Faker\Generator $faker) { +$factory->define(\LVA\Models\Season::class, function (\Faker\Generator $faker) { return [ 'season' => $faker->unique()->word, ]; }); -$factory->define(App\Models\Division::class, function (\Faker\Generator $faker) { +$factory->define(\LVA\Models\Division::class, function (\Faker\Generator $faker) { return [ 'division' => $faker->unique()->word, 'season_id' => function () { - return factory(App\Models\Season::class)->create()->id; + return factory(\LVA\Models\Season::class)->create()->id; }, ]; }); -$factory->define(\App\Models\Club::class, function (\Faker\Generator $faker) { +$factory->define(\LVA\Models\Club::class, function (\Faker\Generator $faker) { return [ 'club' => $faker->unique()->word, ]; }); -$factory->define(App\Models\Team::class, function (\Faker\Generator $faker) { - return [ - 'team' => $faker->unique()->word, - 'club_id' => function () { - return factory(App\Models\Club::class)->create()->id; - }, - ]; -}); - -$factory->define(\App\Models\Role::class, function (\Faker\Generator $faker) { +$factory->define(\LVA\Models\Role::class, function (\Faker\Generator $faker) { return [ 'role' => $faker->unique()->word, ]; }); -$factory->define(\App\Models\Venue::class, function (\Faker\Generator $faker) { - return [ - 'venue' => $faker->unique()->word, - ]; -}); - -$factory->define(\App\Models\Fixture::class, function (\Faker\Generator $faker) { +$factory->define(\LVA\Models\Fixture::class, function (\Faker\Generator $faker) { return [ 'division_id' => function () { - return factory(\App\Models\Division::class)->create()->id; + return factory(\LVA\Models\Division::class)->create()->id; }, 'home_team_id' => function () { - return factory(\App\Models\Team::class)->create()->id; + return factory(\LVA\Models\Team::class)->create()->id; }, 'away_team_id' => function () { - return factory(\App\Models\Team::class)->create()->id; + return factory(\LVA\Models\Team::class)->create()->id; }, 'venue_id' => function () { - return factory(\App\Models\Venue::class)->create()->id; + return factory(\LVA\Models\Venue::class)->create()->id; }, 'match_number' => $faker->unique()->numberBetween(1, 100), 'match_date' => $faker->unique()->date('Y-m-d'), - 'warm_up_time' => $faker->unique()->time('H:i:s'), - 'start_time' => $faker->unique()->time('H:i:s'), + 'warm_up_time' => $faker->unique()->time('H:i:00'), + 'start_time' => $faker->unique()->time('H:i:00'), ]; }); -$factory->define(\App\Models\AvailableAppointment::class, function (\Faker\Generator $faker) { +$factory->define(\LVA\Models\AvailableAppointment::class, function (\Faker\Generator $faker) { return [ 'fixture_id' => function () { - return factory(\App\Models\Fixture::class)->create()->id; + return factory(\LVA\Models\Fixture::class)->create()->id; }, 'role_id' => function () { - return factory(\App\Models\Role::class)->create()->id; + return factory(\LVA\Models\Role::class)->create()->id; }, ]; -}); \ No newline at end of file +}); diff --git a/database/factories/TeamFactories.php b/database/factories/TeamFactories.php new file mode 100644 index 00000000..3bb6003b --- /dev/null +++ b/database/factories/TeamFactories.php @@ -0,0 +1,31 @@ +define(LVA\Models\Team::class, function (\Faker\Generator $faker) { + return [ + 'team' => $faker->unique()->word, + 'club_id' => function () { + return factory(\LVA\Models\Club::class)->create()->id; + }, + ]; +}); + +$factory->define(\LVA\Models\MappedTeam::class, function (\Faker\Generator $faker) { + return [ + 'upload_job_id' => function () { + return factory(\LVA\Models\UploadJob::class)->create()->id; + }, + 'mapped_team' => $faker->unique()->name, + 'team_id' => function () { + return factory(\LVA\Models\Team::class)->create()->id; + }, + ]; +}); + +$factory->define(\LVA\Models\TeamSynonym::class, function (\Faker\Generator $faker) { + return [ + 'synonym' => $faker->unique()->word, + 'team_id' => function () { + return factory(\LVA\Models\Team::class)->create()->id; + }, + ]; +}); diff --git a/database/factories/UploadFactories.php b/database/factories/UploadFactories.php new file mode 100644 index 00000000..f1157599 --- /dev/null +++ b/database/factories/UploadFactories.php @@ -0,0 +1,55 @@ +define(\LVA\Models\UploadJob::class, function (\Faker\Generator $faker) { + return [ + 'file' => $faker->word . str_random(5) . '.csv', + 'type' => 'fixtures', + 'status' => json_encode(['status_code' => \LVA\Models\UploadJobStatus::STATUS_NOT_STARTED]), + 'season_id' => function () { + return factory(\LVA\Models\Season::class)->create()->id; + }, + 'row_count' => $faker->numberBetween(1, 100), + ]; +}); + +$factory->define(\LVA\Models\UploadJobData::class, function (\Faker\Generator $faker) { + return [ + 'upload_job_id' => function () { + return factory(\LVA\Models\UploadJob::class)->create()->id; + }, + 'model' => \LVA\Models\Fixture::class, + 'model_data' => serialize(factory(\LVA\Models\Fixture::class)->make()), + ]; +}); + +$factory->defineAs(\LVA\Models\UploadJobData::class, \LVA\Models\TeamSynonym::class, + function (\Faker\Generator $faker) { + return [ + 'upload_job_id' => function () { + return factory(\LVA\Models\UploadJob::class)->create()->id; + }, + 'model' => \LVA\Models\TeamSynonym::class, + 'model_data' => serialize(factory(\LVA\Models\TeamSynonym::class)->make()), + ]; + }); + +$factory->defineAs(\LVA\Models\UploadJobData::class, \LVA\Models\VenueSynonym::class, + function (\Faker\Generator $faker) { + return [ + 'upload_job_id' => function () { + return factory(\LVA\Models\UploadJob::class)->create()->id; + }, + 'model' => \LVA\Models\VenueSynonym::class, + 'model_data' => serialize(factory(\LVA\Models\VenueSynonym::class)->make()), + ]; + }); + +$factory->defineAs(\LVA\Models\UploadJobData::class, \LVA\Models\Fixture::class, function (\Faker\Generator $faker) { + return [ + 'upload_job_id' => function () { + return factory(\LVA\Models\UploadJob::class)->create()->id; + }, + 'model' => \LVA\Models\Fixture::class, + 'model_data' => serialize(factory(\LVA\Models\Fixture::class)->make()), + ]; +}); diff --git a/database/factories/VenueFactories.php b/database/factories/VenueFactories.php new file mode 100644 index 00000000..4ab7f5aa --- /dev/null +++ b/database/factories/VenueFactories.php @@ -0,0 +1,28 @@ +define(\LVA\Models\Venue::class, function (\Faker\Generator $faker) { + return [ + 'venue' => $faker->unique()->word, + ]; +}); + +$factory->define(\LVA\Models\MappedVenue::class, function (\Faker\Generator $faker) { + return [ + 'upload_job_id' => function () { + return factory(\LVA\Models\UploadJob::class)->create()->id; + }, + 'mapped_venue' => $faker->unique()->name, + 'venue_id' => function () { + return factory(\LVA\Models\Venue::class)->create()->id; + }, + ]; +}); + +$factory->define(\LVA\Models\VenueSynonym::class, function (\Faker\Generator $faker) { + return [ + 'synonym' => $faker->unique()->word, + 'venue_id' => function () { + return factory(\LVA\Models\Venue::class)->create()->id; + }, + ]; +}); \ No newline at end of file diff --git a/database/migrations/2016_09_10_163430_create_upload_jobs_table.php b/database/migrations/2016_09_10_163430_create_upload_jobs_table.php new file mode 100644 index 00000000..632a5446 --- /dev/null +++ b/database/migrations/2016_09_10_163430_create_upload_jobs_table.php @@ -0,0 +1,37 @@ +engine = 'InnoDB'; + + $table->increments('id'); + $table->string('file'); + $table->enum('type', ['fixtures']); + $table->longText('status'); + + $table->timestamps(); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('upload_jobs'); + } +} diff --git a/database/migrations/2016_09_26_180408_add_api_token_to_users_table.php b/database/migrations/2016_09_26_180408_add_api_token_to_users_table.php new file mode 100644 index 00000000..b9ea3731 --- /dev/null +++ b/database/migrations/2016_09_26_180408_add_api_token_to_users_table.php @@ -0,0 +1,35 @@ +string('api_token', 60); + + $table->unique('api_token'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropUnique('users_api_token_unique'); + + $table->dropColumn('api_token'); + }); + } +} diff --git a/database/migrations/2016_11_20_120809_create_synonyms_tables.php b/database/migrations/2016_11_20_120809_create_synonyms_tables.php new file mode 100644 index 00000000..34aaa8b9 --- /dev/null +++ b/database/migrations/2016_11_20_120809_create_synonyms_tables.php @@ -0,0 +1,63 @@ +engine = 'InnoDB'; + + $table->increments('id'); + $table->string('synonym'); + $table->unsignedInteger('venue_id'); + + $table->timestamps(); + + $table->index('synonym'); + $table->index('venue_id'); + + $table->foreign('venue_id')->references('id')->on('venues'); + }); + + Schema::create('teams_synonyms', function (Blueprint $table) { + $table->engine = 'InnoDB'; + + $table->increments('id'); + $table->string('synonym'); + $table->unsignedInteger('team_id'); + + $table->timestamps(); + + $table->index('synonym'); + $table->index('team_id'); + + $table->foreign('team_id')->references('id')->on('teams'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('venues_synonyms', function (Blueprint $table) { + $table->dropForeign(['venue_id']); + }); + Schema::drop('venues_synonyms'); + + Schema::table('teams_synonyms', function (Blueprint $table) { + $table->dropForeign(['team_id']); + }); + Schema::drop('teams_synonyms'); + } +} diff --git a/database/migrations/2016_11_20_123304_create_mapped_venues_and_teams_tables.php b/database/migrations/2016_11_20_123304_create_mapped_venues_and_teams_tables.php new file mode 100644 index 00000000..570172f2 --- /dev/null +++ b/database/migrations/2016_11_20_123304_create_mapped_venues_and_teams_tables.php @@ -0,0 +1,65 @@ +engine = 'InnoDB'; + + $table->increments('id'); + $table->unsignedInteger('upload_job_id'); + $table->string('venue'); + $table->unsignedInteger('venue_id'); + + $table->timestamps(); + + $table->index('venue'); + $table->foreign('upload_job_id')->references('id')->on('upload_jobs'); + $table->foreign('venue_id')->references('id')->on('venues'); + }); + + Schema::create('mapped_teams', function (Blueprint $table) { + $table->engine = 'InnoDB'; + + $table->increments('id'); + $table->unsignedInteger('upload_job_id'); + $table->string('team'); + $table->unsignedInteger('team_id'); + + $table->timestamps(); + + $table->index('team'); + $table->foreign('upload_job_id')->references('id')->on('upload_jobs'); + $table->foreign('team_id')->references('id')->on('teams'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('mapped_venues', function (Blueprint $table) { + $table->dropForeign(['upload_job_id']); + $table->dropForeign(['venue_id']); + }); + Schema::drop('mapped_venues'); + + Schema::table('mapped_teams', function (Blueprint $table) { + $table->dropForeign(['upload_job_id']); + $table->dropForeign(['team_id']); + }); + Schema::drop('mapped_teams'); + } +} diff --git a/database/migrations/2016_11_20_152523_create_upload_jobs_data_table.php b/database/migrations/2016_11_20_152523_create_upload_jobs_data_table.php new file mode 100644 index 00000000..4d26b174 --- /dev/null +++ b/database/migrations/2016_11_20_152523_create_upload_jobs_data_table.php @@ -0,0 +1,42 @@ +engine = 'InnoDB'; + + $table->increments('id'); + + $table->unsignedInteger('upload_job_id'); + $table->string('model'); + $table->text('model_data'); + + $table->timestamps(); + + $table->foreign('upload_job_id')->references('id')->on('upload_jobs'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('upload_jobs_data', function (Blueprint $table) { + $table->dropForeign(['upload_job_id']); + }); + Schema::drop('upload_jobs_data'); + } +} diff --git a/database/migrations/2017_01_21_173202_add_index_for_team_table.php b/database/migrations/2017_01_21_173202_add_index_for_team_table.php new file mode 100644 index 00000000..4d19de6c --- /dev/null +++ b/database/migrations/2017_01_21_173202_add_index_for_team_table.php @@ -0,0 +1,31 @@ +index(['team']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('teams', function (Blueprint $table) { + $table->dropIndex(['team']); + }); + } +} diff --git a/database/migrations/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.php b/database/migrations/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.php new file mode 100644 index 00000000..a26bd226 --- /dev/null +++ b/database/migrations/2017_01_29_160139_add_row_count_field_to_upload_jobs_table.php @@ -0,0 +1,31 @@ +unsignedInteger('row_count')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('upload_jobs', function (Blueprint $table) { + $table->dropColumn('row_count'); + }); + } +} diff --git a/database/migrations/2017_02_06_113853_add_season_field_to_upload_jobs_table.php b/database/migrations/2017_02_06_113853_add_season_field_to_upload_jobs_table.php new file mode 100644 index 00000000..d7d1faef --- /dev/null +++ b/database/migrations/2017_02_06_113853_add_season_field_to_upload_jobs_table.php @@ -0,0 +1,34 @@ +unsignedInteger('season_id'); + + $table->foreign('season_id')->references('id')->on('seasons'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('upload_jobs', function (Blueprint $table) { + $table->dropForeign(['season_id']); + $table->dropColumn('season_id'); + }); + } +} diff --git a/database/migrations/2017_02_07_165431_rename_team_field_in_mapped_teams_name.php b/database/migrations/2017_02_07_165431_rename_team_field_in_mapped_teams_name.php new file mode 100644 index 00000000..35840d86 --- /dev/null +++ b/database/migrations/2017_02_07_165431_rename_team_field_in_mapped_teams_name.php @@ -0,0 +1,35 @@ +dropIndex(['team']); + $table->renameColumn('team', 'mapped_team'); + $table->index(['mapped_team']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('mapped_teams', function (Blueprint $table) { + $table->dropIndex(['mapped_team']); + $table->renameColumn('mapped_team', 'team'); + $table->index(['team']); + }); + } +} diff --git a/database/migrations/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.php b/database/migrations/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.php new file mode 100644 index 00000000..ef18e391 --- /dev/null +++ b/database/migrations/2017_02_07_165447_rename_venue_field_in_mapped_venues_name.php @@ -0,0 +1,35 @@ +dropIndex(['venue']); + $table->renameColumn('venue', 'mapped_venue'); + $table->index(['mapped_venue']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('mapped_venues', function (Blueprint $table) { + $table->dropIndex(['mapped_venue']); + $table->renameColumn('mapped_venue', 'venue'); + $table->index(['venue']); + }); + } +} diff --git a/database/migrations/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.php b/database/migrations/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.php new file mode 100644 index 00000000..df70cbd1 --- /dev/null +++ b/database/migrations/2017_03_13_105646_change_index_on_synonyms_tables_to_be_unique.php @@ -0,0 +1,43 @@ +dropIndex(['synonym']); + $table->unique(['synonym']); + }); + + Schema::table('venues_synonyms', function (Blueprint $table) { + $table->dropIndex(['synonym']); + $table->unique(['synonym']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('teams_synonyms', function (Blueprint $table) { + $table->dropUnique(['synonym']); + $table->index(['synonym']); + }); + + Schema::table('venues_synonyms', function (Blueprint $table) { + $table->dropUnique(['synonym']); + $table->index(['synonym']); + }); + } +} diff --git a/env.travis b/env.travis index 0eb8c523..0a6f4555 100644 --- a/env.travis +++ b/env.travis @@ -1,4 +1,4 @@ -APP_ENV=trevis +APP_ENV=travis APP_DEBUG=true APP_KEY=SomeRandomString diff --git a/gulpfile.js b/gulpfile.js index abe699ab..7b5b6b71 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,17 +14,15 @@ var elixir = require('laravel-elixir'); elixir(function (mix) { // Styles mix.sass('app.scss'); + mix.sass('data-management.scss'); + mix.sass('load-fixtures.scss'); // Javascript mix.browserify('app.js'); mix.browserify('confirm-delete.js'); + mix.browserify('file-browse.js'); + mix.browserify('load-fixtures-status-update.js'); // Versioning - mix.version([ - // Stylesheets - 'css/app.css', - // Javascripts - 'js/app.js', - 'js/confirm-delete.js' - ]); + mix.version(['css/*.css', 'js/*.js']); }); diff --git a/phpunit.xml b/phpunit.xml index 022d4029..8193fdd8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,6 +23,7 @@ + diff --git a/public/images/lva-logo.png b/public/images/lva-logo.png index 38f4c1b0..a7299915 100644 Binary files a/public/images/lva-logo.png and b/public/images/lva-logo.png differ diff --git a/public/libraries/bootstrap-confirmation.2.4.0.min.js b/public/libraries/bootstrap-confirmation.2.4.0.min.js new file mode 100644 index 00000000..45755b6b --- /dev/null +++ b/public/libraries/bootstrap-confirmation.2.4.0.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap Confirmation 2.4.0 + * Copyright 2013 Nimit Suwannagate + * Copyright 2014-2016 Damien "Mistic" Sorel + * Licensed under the Apache License, Version 2.0 + */ +!function($){"use strict";function a(a){for(var b=window,c=a.split("."),d=c.pop(),e=0,f=c.length;e

'}),c.prototype=$.extend({},$.fn.popover.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.init=function(a,b){if($.fn.popover.Constructor.prototype.init.call(this,"confirmation",a,b),(this.options.popout||this.options.singleton)&&!b.rootSelector)throw new Error("The rootSelector option is required to use popout and singleton features since jQuery 3.");this.options._isDelegate=!1,b.selector?this.options._selector=this._options._selector=b.rootSelector+" "+b.selector:b._selector?(this.options._selector=b._selector,this.options._isDelegate=!0):this.options._selector=b.rootSelector;var c=this;this.options.selector?this.$element.on(this.options.trigger,this.options.selector,function(a,b){b||(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation())}):(this.options._attributes={},this.options.copyAttributes?"string"==typeof this.options.copyAttributes&&(this.options.copyAttributes=this.options.copyAttributes.split(" ")):this.options.copyAttributes=[],this.options.copyAttributes.forEach(function(a){this.options._attributes[a]=this.$element.attr(a)},this),this.$element.on(this.options.trigger,function(a,b){b||(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation())}),this.$element.on("show.bs.confirmation",function(a){c.options.singleton&&$(c.options._selector).not($(this)).filter(function(){return void 0!==$(this).data("bs.confirmation")}).confirmation("hide")})),this.options._isDelegate||(this.eventBody=!1,this.uid=this.$element[0].id||this.getUID("group_"),this.$element.on("shown.bs.confirmation",function(a){c.options.popout&&!c.eventBody&&(c.eventBody=$("body").on("click.bs.confirmation."+c.uid,function(a){$(c.options._selector).is(a.target)||($(c.options._selector).filter(function(){return void 0!==$(this).data("bs.confirmation")}).confirmation("hide"),$("body").off("click.bs."+c.uid),c.eventBody=!1)}))}))},c.prototype.hasContent=function(){return!0},c.prototype.setContent=function(){var a=this,c=this.tip(),d=this.getTitle(),e=this.getContent();if(c.find(".popover-title")[this.options.html?"html":"text"](d),c.find(".confirmation-content").toggle(!!e).children().detach().end()[this.options.html?"string"==typeof e?"html":"append":"text"](e),c.on("click",function(a){a.stopPropagation()}),this.options.buttons){var f=c.find(".confirmation-buttons .btn-group").empty();this.options.buttons.forEach(function(b){f.append($('').addClass(b["class"]||"btn btn-xs btn-default").html(b.label||"").attr(b.attr||{}).prepend($("").addClass(b.icon)," ").one("click",function(c){"#"===$(this).attr("href")&&c.preventDefault(),b.onClick&&b.onClick.call(a.$element),b.cancel?(a.getOnCancel.call(a).call(a.$element),a.$element.trigger("canceled.bs.confirmation")):(a.getOnConfirm.call(a).call(a.$element),a.$element.trigger("confirmed.bs.confirmation")),a.inState&&(a.inState.click=!1),a.hide()}))},this)}else c.find('[data-apply="confirmation"]').addClass(this.options.btnOkClass).html(this.options.btnOkLabel).attr(this.options._attributes).prepend($("").addClass(this.options.btnOkIcon)," ").off("click").one("click",function(b){"#"===$(this).attr("href")&&b.preventDefault(),a.getOnConfirm.call(a).call(a.$element),a.$element.trigger("confirmed.bs.confirmation"),a.$element.trigger(a.options.trigger,[!0]),a.hide()}),c.find('[data-dismiss="confirmation"]').addClass(this.options.btnCancelClass).html(this.options.btnCancelLabel).prepend($("").addClass(this.options.btnCancelIcon)," ").off("click").one("click",function(b){b.preventDefault(),a.getOnCancel.call(a).call(a.$element),a.$element.trigger("canceled.bs.confirmation"),a.inState&&(a.inState.click=!1),a.hide()});c.removeClass("fade top bottom left right in"),c.find(".popover-title").html()||c.find(".popover-title").hide(),b=this,$(window).off("keyup.bs.confirmation").on("keyup.bs.confirmation",this._onKeyup.bind(this))},c.prototype.destroy=function(){b===this&&(b=void 0,$(window).off("keyup.bs.confirmation")),$.fn.popover.Constructor.prototype.destroy.call(this)},c.prototype.hide=function(){b===this&&(b=void 0,$(window).off("keyup.bs.confirmation")),$.fn.popover.Constructor.prototype.hide.call(this)},c.prototype._onKeyup=function(a){if(!this.$tip)return b=void 0,void $(window).off("keyup.bs.confirmation");var d,e=a.key||c.KEYMAP[a.keyCode||a.which],f=this.$tip.find(".confirmation-buttons .btn-group"),g=f.find(".active");switch(e){case"Escape":this.hide();break;case"ArrowRight":d=g.length&&g.next().length?g.next():f.children().first(),g.removeClass("active"),d.addClass("active").focus();break;case"ArrowLeft":d=g.length&&g.prev().length?g.prev():f.children().last(),g.removeClass("active"),d.addClass("active").focus()}},c.prototype.getOnConfirm=function(){return this.$element.attr("data-on-confirm")?a(this.$element.attr("data-on-confirm")):this.options.onConfirm},c.prototype.getOnCancel=function(){return this.$element.attr("data-on-cancel")?a(this.$element.attr("data-on-cancel")):this.options.onCancel};var d=$.fn.confirmation;$.fn.confirmation=function(a){var b="object"==typeof a&&a||{};return b.rootSelector=this.selector||b.rootSelector,this.each(function(){var d=$(this),e=d.data("bs.confirmation");(e||"destroy"!=a)&&(e||d.data("bs.confirmation",e=new c(this,b)),"string"==typeof a&&(e[a](),"hide"==a&&e.inState&&(e.inState.click=!1)))})},$.fn.confirmation.Constructor=c,$.fn.confirmation.noConflict=function(){return $.fn.confirmation=d,this}}(jQuery); \ No newline at end of file diff --git a/resources/assets/js/confirm-delete.js b/resources/assets/js/confirm-delete.js index 7b8c7d2f..49b5079d 100644 --- a/resources/assets/js/confirm-delete.js +++ b/resources/assets/js/confirm-delete.js @@ -5,6 +5,6 @@ (function ($) { $('[data-toggle=confirmation]').confirmation({ singleton: true, - popout: true, + popout : true }); })(jQuery); \ No newline at end of file diff --git a/resources/assets/js/file-browse.js b/resources/assets/js/file-browse.js new file mode 100644 index 00000000..bf3c4dae --- /dev/null +++ b/resources/assets/js/file-browse.js @@ -0,0 +1,30 @@ +/** + * Created by Giulio Troccoli-Allard on 25/08/2016. + * + * https://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3 + */ +(function ($) { + // We can attach the `fileselect` event to all file inputs on the page + $('form').on('change', ':file', function () { + var input = $(this), + numFiles = input.get(0).files ? input.get(0).files.length : 1, + label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); + input.trigger('fileselect', [numFiles, label]); + }); + + // We can watch for our custom `fileselect` event like this + $(document).ready(function () { + $(':file').on('fileselect', function (event, numFiles, label) { + + var input = $(this).parents('.input-group').find(':text'), + log = numFiles > 1 ? numFiles + ' files selected' : label; + + if (input.length) { + input.val(log); + } else { + if (log) alert(log); + } + + }); + }); +})(jQuery); \ No newline at end of file diff --git a/resources/assets/js/load-fixtures-status-update.js b/resources/assets/js/load-fixtures-status-update.js new file mode 100644 index 00000000..6dac2fd7 --- /dev/null +++ b/resources/assets/js/load-fixtures-status-update.js @@ -0,0 +1,261 @@ +/** + * Created by Giulio Troccoli-Allard on 10/09/2016. + */ +(function ($) { + "use strict"; + + var apiToken = $('#api_token').val(), + jobId = $('#job_id').val(), + userActionModal = $('#user-action-modal'), + userConfirmationModal = $('#user-confirmation-modal'), + lastTimestamp = 0, + + // These variables reflects the statuses maintaned in the UploadJobStatus model class + statusValidating = 10, + statusUnknownData = 11, + statusErrorValidating = 19, + statusWaitingConfirmation = 20, + statusInserting = 30, + statusErrorInserting = 39, + statusDone = 99, + + updateProgressBar = function updateProgressBar(bar, progress) { + bar.removeClass('hidden'); + bar.find('.progress-bar') + .css('width', progress + '%') + .attr('aria-valuenow', progress) + .find('.sr-only').html(progress + '% Complete'); + + if (progress == 100) { + bar.find('.progress-bar') + .removeClass('progress-bar-striped active') + .addClass('progress-bar-success'); + } + }, + + disableRow = function disableRow(row) { + row.off('click', '.add-button').off('click', '.map-button'); + row.find('button').addClass('disabled').blur(); + row.find('select').prop('disabled', true); + row.css('opacity', 0.5); + + if ($('#unknowns').find('button').not('.disabled').length == 0) { + $('#resume-button').removeClass('disabled'); + } + }, + + ShowLoading = function ShowLoading(row) { + row.find('button:focus').blur(); + row.LoadingOverlay("show", {image: "", fontawesome: "fa fa-spinner fa-spin", zIndex: 10000}); + }, + + HideLoading = function HideLoading(row) { + row.LoadingOverlay("hide"); + }, + + AddUnknown = function AddUnknow(e) { + var row = $(e.target).parent('.unknown.row'), + name = row.find('p').text(); + + console.log('Calling ' + $(e.target).data('apiurl') + ' to add ' + name); + ShowLoading(row); + $.post({ + url : $(e.target).data('apiurl'), + data : { + name : name, + job : jobId, + api_token: apiToken + }, + dataType: 'json' + }).done(function (data) { + if (data.success) { + disableRow(row); + } + }).always(function () { + HideLoading(row); + }); + }, + + MapUnknown = function MapUnknow(e) { + var row = $(e.target).parent('.unknown.row'), + name = row.find('p').text(), + option = row.find('select').find('option:selected').text(); + + console.log('Calling ' + $(e.target).data('apiurl') + ' to map ' + name + ' to ' + option); + ShowLoading(row); + $.post({ + url : $(e.target).data('apiurl'), + data : { + name : name, + newName : option, + job : jobId, + api_token: apiToken + }, + dataType: 'json' + }).done(function (data) { + if (data.success) { + disableRow(row); + } + }).always(function () { + HideLoading(row); + }); + }, + + populateCurrentFixture = function populateCurrentFixture(element, fixture) { + element.find('#fixture-division').text(fixture.Division); + element.find('#fixture-match-number').text(fixture.MatchNumber); + element.find('#fixture-home-team').text(fixture.HomeTeam); + element.find('#fixture-away-team').text(fixture.AwayTeam); + element.find('#fixture-date').text(fixture.Date); + element.find('#fixture-warm-up-time').text(fixture.WarmUpTime); + element.find('#fixture-start-time').text(fixture.StartTime); + element.find('#fixture-venue').text(fixture.Venue); + }, + + createUnknownRow = function createUnknownRow(tmplId, text, map) { + var unknown = $('#' + tmplId).clone(true).removeClass('hidden').attr('id', ''), + addButton = unknown.find('.add-button'), + mapButton = unknown.find('.map-button'); + + unknown.find('p').text(text); + if (map.ApiUrls.Add) { + addButton.data('apiurl', map.ApiUrls.Add); + addButton.on('click', AddUnknown); + } else { + addButton.addClass('disabled').blur(); + } + + if (map.ApiUrls.Map) { + var select = unknown.find('select'); + $.each(map.Mapping, function (index, option) { + var $option = $("") + .attr("value", option.value) + .text(option.text); + select.append($option); + }); + mapButton.data('apiurl', map.ApiUrls.Map); + mapButton.on('click', MapUnknown); + } else { + mapButton.addClass('disabled').blur(); + } + + return unknown; + }, + + poll = function poll() { + $.get({ + url : '/api/v1/uploads/status.json', + data : { + job : jobId, + api_token: apiToken + }, + dataType: 'json' + }).done(function (data) { + if (lastTimestamp == data.Timestamp) { + setTimeout(poll, 500); + return; + } + lastTimestamp = data.Timestamp; + + if (data.Error) { + $('#message').html(data.Message); + return; + } + var status = data.Status; + + if (status.StatusCode >= statusValidating) { + var validatingProgress = status.StatusCode < (statusValidating + 10) ? status.Progress : 100; + updateProgressBar($('#validating-progress'), validatingProgress); + } + if (status.StatusCode >= statusInserting) { + var insertingProgress = status.StatusCode < (statusInserting + 10) ? status.Progress : 100; + updateProgressBar($('#inserting-progress'), insertingProgress); + } + + if (status.StatusCode == statusUnknownData) { + userActionModal.find('.modal-title').text(status.StatusMessage); + + populateCurrentFixture(userActionModal, status.Fixture); + + userActionModal.find('#unknowns').empty(); + $.each(status.Unknowns, function (field, map) { + var newUnknown = createUnknownRow('unknown-data-template', status.Fixture[field], map); + userActionModal.find('#unknowns').append(newUnknown); + }); + + $('#resume-button').addClass('disabled').blur(); + userActionModal.modal('show'); + + } else if (status.StatusCode == statusWaitingConfirmation) { + // create confirmation pop up + userConfirmationModal.modal('show'); + // if user click on Proceed + // call to resume + // else + // call clean-up + } else if (status.StatusCode == statusErrorValidating || status.StatusCode == statusErrorInserting) { + var alert = $('#unrecoverable-errors'); + if (status.ErrorLine) { + var errorLine = alert.find('#error-line-number'); + + errorLine.find('span').text(status.ErrorLine); + errorLine.removeClass('hidden'); + } + $.each(status.Errors, function (key, error) { + alert.find('ul').append($('
  • ' + error + '
  • ')) + }); + alert.removeClass('hidden'); + if (status.StatusCode == statusErrorValidating) { + $('#validating-progress .progress-bar').removeClass('progress-bar-striped active').addClass('progress-bar-danger'); + } else if (status.StatusCode == statusErrorInserting) { + $('#inserting-progress .progress-bar').removeClass('progress-bar-striped active').addClass('progress-bar-danger'); + } + } else if (status.StatusCode != statusDone) { + setTimeout(poll, 500); + } + + }); + }, + + resume = function restart() { + // Restart the uploading + $.get({ + url : '/api/v1/uploads/resume', + data : { + job : jobId, + api_token: apiToken + }, + async: true + }); + }, + + abandon = function abandon() { + // Abandon the uploading + $.get({ + url : '/api/v1/uploads/abandon', + data: { + job : jobId, + api_token: apiToken + } + }); + location.href = '/admin/data-management/upload/fixtures'; + }; + + resume(); + poll(); + + $('.modal').modal({background: false, keyboard: false, show: false}); + $('.modal').on('hidden.bs.modal', function () { + setTimeout(poll, 500); + }); + + $('#resume-button').on('click', function () { + resume(); + }); + $('#abandon-button').on('click', function (event) { + abandon(); + }); + $('#continue-button').on('click', function (event) { + resume(); + }); +})(jQuery); \ No newline at end of file diff --git a/resources/assets/sass/app.scss b/resources/assets/sass/app.scss index d9465cee..a008f9a9 100644 --- a/resources/assets/sass/app.scss +++ b/resources/assets/sass/app.scss @@ -3,8 +3,3 @@ @import "partials/navbar"; @import "partials/breadcrumbs"; @import "partials/lva-header"; - -#page-content { - //position: absolute; - //top: 348px; -} \ No newline at end of file diff --git a/resources/assets/sass/data-management.scss b/resources/assets/sass/data-management.scss new file mode 100644 index 00000000..d0f88dce --- /dev/null +++ b/resources/assets/sass/data-management.scss @@ -0,0 +1,8 @@ +ul.nav-stacked { + li { + a { + padding-top: 5px; + padding-bottom: 5px; + } + } +} \ No newline at end of file diff --git a/resources/assets/sass/load-fixtures.scss b/resources/assets/sass/load-fixtures.scss new file mode 100644 index 00000000..a6a4c50a --- /dev/null +++ b/resources/assets/sass/load-fixtures.scss @@ -0,0 +1,17 @@ +#load-fixture-modal { + .modal-dialog { + width: 69%; + .unknown.row { + margin-bottom: 5px; + p { + margin-top: 7px; + margin-bottom: 0; + } + } + .add-button, + .map-button { + padding-left: 8px; + padding-right: 8px; + } + } +} diff --git a/resources/assets/sass/partials/breadcrumbs.scss b/resources/assets/sass/partials/_breadcrumbs.scss similarity index 100% rename from resources/assets/sass/partials/breadcrumbs.scss rename to resources/assets/sass/partials/_breadcrumbs.scss diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 2649f435..77f28ae1 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -88,7 +88,7 @@ | */ - 'custom' => [ + 'custom' => [ 'season' => [ 'unique' => 'The season already exists.', ], @@ -106,8 +106,9 @@ ], 'venue' => [ 'unique' => 'The venue already exists.', - ] + ], ], + 'required_headers' => 'The :headers fields must all be present in the file.', /* |-------------------------------------------------------------------------- diff --git a/resources/views/admin/data-management/available-appointments/_form.blade.php b/resources/views/admin/data-management/available-appointments/_form.blade.php new file mode 100644 index 00000000..6469970e --- /dev/null +++ b/resources/views/admin/data-management/available-appointments/_form.blade.php @@ -0,0 +1,21 @@ +
    + {!! Form::label('fixture_id', 'Fixture: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('fixture_id', $fixturesSelect, null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('fixture_id', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('role_id', 'Role: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('role_id', array_column($roles->toArray(), 'role', 'id'), null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('role_id', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    \ No newline at end of file diff --git a/resources/views/admin/data-management/available-appointments/create.blade.php b/resources/views/admin/data-management/available-appointments/create.blade.php index 7698fa00..10d2fe13 100644 --- a/resources/views/admin/data-management/available-appointments/create.blade.php +++ b/resources/views/admin/data-management/available-appointments/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content') 'admin/data-management/available-appointments', 'class' => 'form-horizontal']) !!} + {!! Form::open(['route' => 'admin.data-management.available-appointments.store', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('fixture_id', 'Fixture: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('fixture_id', $fixturesSelect, null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('fixture_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('role_id', 'Role: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('role_id', array_column($roles->toArray(), 'role', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('role_id', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.available-appointments._form', ['submitText' => 'Add']) {!! Form::close() !!} diff --git a/resources/views/admin/data-management/available-appointments/edit.blade.php b/resources/views/admin/data-management/available-appointments/edit.blade.php index 88470474..f60fbca4 100644 --- a/resources/views/admin/data-management/available-appointments/edit.blade.php +++ b/resources/views/admin/data-management/available-appointments/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content') 'PATCH', - 'url' => ['admin/data-management/available-appointments', $availableAppointment->id], + 'route' => ['admin.data-management.available-appointments.update', $availableAppointment->id], 'class' => 'form-horizontal' ]) !!} - {!! Form::hidden('id', $availableAppointment->id) !!} -
    - {!! Form::label('fixture_id', 'Fixture: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('fixture_id', $fixturesSelect, null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('fixture_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('role_id', 'Role: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('role_id', array_column($roles->toArray(), 'role', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('role_id', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.available-appointments._form', ['submitText' => 'Update']) {!! Form::close() !!} diff --git a/resources/views/admin/data-management/available-appointments/index.blade.php b/resources/views/admin/data-management/available-appointments/index.blade.php index 64e24052..4a538c8d 100644 --- a/resources/views/admin/data-management/available-appointments/index.blade.php +++ b/resources/views/admin/data-management/available-appointments/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Available appointments New appointment

    - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/available-appointments', $appointment->id], @@ -46,6 +46,6 @@ class="btn btn-primary pull-right btn-sm">New appointment @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/available-appointments/show.blade.php b/resources/views/admin/data-management/available-appointments/show.blade.php index 4a003e4f..227c6889 100644 --- a/resources/views/admin/data-management/available-appointments/show.blade.php +++ b/resources/views/admin/data-management/available-appointments/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Available appointment

    diff --git a/resources/views/admin/data-management/clubs/_form.blade.php b/resources/views/admin/data-management/clubs/_form.blade.php new file mode 100644 index 00000000..4dbf9f66 --- /dev/null +++ b/resources/views/admin/data-management/clubs/_form.blade.php @@ -0,0 +1,13 @@ +
    + {!! Form::label('club', 'Club: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::text('club', null, ['class' => 'form-control', 'required' => true, 'autofocus' => true]) !!} + {!! $errors->first('club', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    \ No newline at end of file diff --git a/resources/views/admin/data-management/clubs/create.blade.php b/resources/views/admin/data-management/clubs/create.blade.php index fba72686..1b990412 100644 --- a/resources/views/admin/data-management/clubs/create.blade.php +++ b/resources/views/admin/data-management/clubs/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Add a new club

    @@ -10,19 +10,7 @@ {!! Form::open(['url' => 'admin/data-management/clubs', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('club', 'Club: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('club', null, ['class' => 'form-control']) !!} - {!! $errors->first('club', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.clubs._form', ['submitText' => 'Add']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/clubs/edit.blade.php b/resources/views/admin/data-management/clubs/edit.blade.php index a593dc80..c580bfef 100644 --- a/resources/views/admin/data-management/clubs/edit.blade.php +++ b/resources/views/admin/data-management/clubs/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Edit club

    @@ -14,19 +14,7 @@ 'class' => 'form-horizontal' ]) !!} -
    - {!! Form::label('club', 'Club: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('club', null, ['class' => 'form-control']) !!} - {!! $errors->first('club', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.clubs._form', ['submitText' => 'Update']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/clubs/index.blade.php b/resources/views/admin/data-management/clubs/index.blade.php index 7f0630aa..c0c1d77b 100644 --- a/resources/views/admin/data-management/clubs/index.blade.php +++ b/resources/views/admin/data-management/clubs/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Clubs New @@ -20,7 +20,7 @@ - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/clubs', $club->id], @@ -40,6 +40,6 @@ @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/clubs/show.blade.php b/resources/views/admin/data-management/clubs/show.blade.php index 413d4200..6de65e44 100644 --- a/resources/views/admin/data-management/clubs/show.blade.php +++ b/resources/views/admin/data-management/clubs/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Club

    diff --git a/resources/views/admin/data-management/divisions/_form.blade.php b/resources/views/admin/data-management/divisions/_form.blade.php new file mode 100644 index 00000000..57ddb175 --- /dev/null +++ b/resources/views/admin/data-management/divisions/_form.blade.php @@ -0,0 +1,21 @@ +
    + {!! Form::label('season_id', 'Season: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('season_id', array_column($seasons->toArray(), 'season', 'id'), null, ['class' => 'form-control']) !!} + {!! $errors->first('season_id', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('division', 'Division: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::text('division', null, ['class' => 'form-control', 'required' => true, 'autofocus' => true]) !!} + {!! $errors->first('division', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    \ No newline at end of file diff --git a/resources/views/admin/data-management/divisions/create.blade.php b/resources/views/admin/data-management/divisions/create.blade.php index 1950be54..2e6d3657 100644 --- a/resources/views/admin/data-management/divisions/create.blade.php +++ b/resources/views/admin/data-management/divisions/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Add new division

    @@ -10,27 +10,7 @@ {!! Form::open(['url' => 'admin/data-management/divisions', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('season_id', 'Season: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('season_id', array_column($seasons->toArray(), 'season', 'id'), null, ['class' => 'form-control']) !!} - {!! $errors->first('season_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('division', 'Division: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('division', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('division', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.divisions._form', ['submitText' => 'Add']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/divisions/edit.blade.php b/resources/views/admin/data-management/divisions/edit.blade.php index 7725ab70..b4f41fd4 100644 --- a/resources/views/admin/data-management/divisions/edit.blade.php +++ b/resources/views/admin/data-management/divisions/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Edit division

    @@ -14,27 +14,7 @@ 'class' => 'form-horizontal' ]) !!} -
    - {!! Form::label('season_id', 'Season: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('season_id', array_column($seasons->toArray(), 'season', 'id'), $division->season->id, ['class' => 'form-control']) !!} - {!! $errors->first('season_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('division', 'Division: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('division', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('division', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.divisions._form', ['submitText' => 'Update']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/divisions/index.blade.php b/resources/views/admin/data-management/divisions/index.blade.php index 5c7729f6..25ca41c9 100644 --- a/resources/views/admin/data-management/divisions/index.blade.php +++ b/resources/views/admin/data-management/divisions/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Divisions New division

    - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/divisions', $division->id], @@ -44,6 +44,6 @@ class="btn btn-primary pull-right btn-sm">New division

    @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/divisions/show.blade.php b/resources/views/admin/data-management/divisions/show.blade.php index 61b293eb..b4b2df1a 100644 --- a/resources/views/admin/data-management/divisions/show.blade.php +++ b/resources/views/admin/data-management/divisions/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Division

    diff --git a/resources/views/admin/data-management/fixtures/_form.blade.php b/resources/views/admin/data-management/fixtures/_form.blade.php new file mode 100644 index 00000000..929f11e8 --- /dev/null +++ b/resources/views/admin/data-management/fixtures/_form.blade.php @@ -0,0 +1,69 @@ +
    + {!! Form::label('division_id', 'Division: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('division_id', array_column($divisions->toArray(), 'division', 'id'), null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('division_id', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('match_number', 'Match Number: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::number('match_number', null, ['class' => 'form-control', 'required' => true, 'autofocus' => true]) !!} + {!! $errors->first('match_number', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('match_date', 'Match Date: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::date('match_date', null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('match_date', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('warm_up_time', 'Warm Up Time: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::input('time', 'warm_up_time', null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('warm_up_time', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('start_time', 'Start Time: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::input('time', 'start_time', null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('start_time', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('home_team_id', 'Home Team: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('home_team_id', array_column($teams->toArray(), 'team', 'id'), null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('home_team_id', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('away_team_id', 'Away Team: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('away_team_id', array_column($teams->toArray(), 'team', 'id'), null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('away_team_id', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('venue_id', 'Venue: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('venue_id', array_column($venues->toArray(), 'venue', 'id'), null, ['class' => 'form-control', 'required' => true]) !!} + {!! $errors->first('venue_id', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    diff --git a/resources/views/admin/data-management/fixtures/create.blade.php b/resources/views/admin/data-management/fixtures/create.blade.php index f8eda342..fb3ee8db 100644 --- a/resources/views/admin/data-management/fixtures/create.blade.php +++ b/resources/views/admin/data-management/fixtures/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Add new fixture

    @@ -10,75 +10,7 @@ {!! Form::open(['url' => 'admin/data-management/fixtures', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('division_id', 'Division: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('division_id', array_column($divisions->toArray(), 'division', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('division_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('match_number', 'Match Number: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::number('match_number', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('match_number', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('match_date', 'Match Date: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::date('match_date', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('match_date', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('warm_up_time', 'Warm Up Time: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::input('time', 'warm_up_time', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('warm_up_time', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('start_time', 'Start Time: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::input('time', 'start_time', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('start_time', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('home_team_id', 'Home Team: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('home_team_id', array_column($teams->toArray(), 'team', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('home_team_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('away_team_id', 'Away Team: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('away_team_id', array_column($teams->toArray(), 'team', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('away_team_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('venue_id', 'Venue: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('venue_id', array_column($venues->toArray(), 'venue', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('venue_id', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.fixtures._form', ['submitText' => 'Add']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/fixtures/edit.blade.php b/resources/views/admin/data-management/fixtures/edit.blade.php index e66f7b16..a3a474b7 100644 --- a/resources/views/admin/data-management/fixtures/edit.blade.php +++ b/resources/views/admin/data-management/fixtures/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Edit fixture

    @@ -13,76 +13,9 @@ 'url' => ['admin/data-management/fixtures', $fixture->id], 'class' => 'form-horizontal' ]) !!} + {!! Form::hidden('id', $fixture->id) !!} -
    - {!! Form::label('division_id', 'Division Id: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('division_id', array_column($divisions->toArray(), 'division', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('division_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('match_number', 'Match Number: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::number('match_number', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('match_number', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('match_date', 'Match Date: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::date('match_date', $fixture->match_date->format('Y-m-d'), ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('match_date', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('warm_up_time', 'Warm Up Time: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::input('time', 'warm_up_time', $fixture->warm_up_time->format('H:i'), ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('warm_up_time', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('start_time', 'Start Time: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::input('time', 'start_time', $fixture->start_time->format('H:i'), ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('start_time', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('home_team_id', 'Home Team Id: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('home_team_id', array_column($teams->toArray(), 'team', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('home_team_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('away_team_id', 'Away Team Id: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('away_team_id', array_column($teams->toArray(), 'team', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('away_team_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('venue_id', 'Venue Id: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('venue_id', array_column($venues->toArray(), 'venue', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('venue_id', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.fixtures._form', ['submitText' => 'Update']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/fixtures/index.blade.php b/resources/views/admin/data-management/fixtures/index.blade.php index b18ab69a..ad58ba0b 100644 --- a/resources/views/admin/data-management/fixtures/index.blade.php +++ b/resources/views/admin/data-management/fixtures/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Fixtures New fixture

    Date - Warm-up time - Start time + Warm-up + Start Home Away Venue @@ -36,7 +36,7 @@ class="btn btn-primary pull-right btn-sm">New fixture - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/fixtures', $fixture->id], @@ -56,6 +56,6 @@ class="btn btn-primary pull-right btn-sm">New fixture @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/fixtures/show.blade.php b/resources/views/admin/data-management/fixtures/show.blade.php index bf414028..b7ef2ae4 100644 --- a/resources/views/admin/data-management/fixtures/show.blade.php +++ b/resources/views/admin/data-management/fixtures/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Fixture

    diff --git a/resources/views/admin/data-management/home.blade.php b/resources/views/admin/data-management/home.blade.php index 9f4f9507..c74834ad 100644 --- a/resources/views/admin/data-management/home.blade.php +++ b/resources/views/admin/data-management/home.blade.php @@ -1,47 +1,89 @@ @extends('layouts.app') +@section('stylesheets') + +@endsection @section('content')
    -

    From here you can manage all the data. Click on the button of teh table you want to use and from there - you will be able to add, modify and delete records.

    - - - @yield('crud') +
    +
    +
    +

    + Direct data management +

    +
    +
    +

    + This is where you manage raw data: add, delete or update records. +

    + +
    +
    +
    +
    +
    +
    +
    + Start of season +
    +
    +
    +

    + Tasks to be typically carried out at the beginning of a new season +

    + +
    +
    +
    @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/load/fixtures.blade.php b/resources/views/admin/data-management/load/fixtures.blade.php new file mode 100644 index 00000000..937a3043 --- /dev/null +++ b/resources/views/admin/data-management/load/fixtures.blade.php @@ -0,0 +1,47 @@ +@extends('layouts.app') + +@section('content') + +
    +

    Upload fixtures

    +
    + {!! Form::open(['url' => route('uploadFixtures'), 'class' => 'form-horizontal', 'files' => true]) !!} + +
    + {!! Form::label('season_id', 'Season: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('season_id', array_column($seasons->toArray(), 'season', 'id'), null, ['class' => 'form-control']) !!} + {!! $errors->first('season_id', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('upload_file', 'File: ', ['class' => 'col-sm-3 control-label']) !!} +
    +
    + + +
    + {!! $errors->first('upload_file', '

    :message

    ') !!} +
    +
    + + +
    +
    + {!! Form::submit('Start', ['class' => 'btn btn-primary form-control']) !!} +
    +
    + + {!! Form::close() !!} +
    + +@endsection + +@section('javascript') + +@endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/load/status.blade.php b/resources/views/admin/data-management/load/status.blade.php new file mode 100644 index 00000000..c4b08674 --- /dev/null +++ b/resources/views/admin/data-management/load/status.blade.php @@ -0,0 +1,134 @@ +@extends('layouts.app') + +@section('stylesheets') + +@endsection + +@section('content') + {!! Form::hidden('api_token', Auth::user()->api_token, ['id' => 'api_token']) !!} + {!! Form::hidden('job_id', $job->id, ['id' => 'job_id']) !!} +
    +
    +
    +

    Processing {{$job->file}}

    + + +
    +
    +

    + +
    + + + + +@endsection + +@section('javascript') + + +@endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/roles/_form.blade.php b/resources/views/admin/data-management/roles/_form.blade.php new file mode 100644 index 00000000..cebca978 --- /dev/null +++ b/resources/views/admin/data-management/roles/_form.blade.php @@ -0,0 +1,13 @@ +
    + {!! Form::label('role', 'Role: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::text('role', null, ['class' => 'form-control', 'required' => true, 'autofocus' => true]) !!} + {!! $errors->first('role', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    \ No newline at end of file diff --git a/resources/views/admin/data-management/roles/create.blade.php b/resources/views/admin/data-management/roles/create.blade.php index 1609ae4c..4cea376d 100644 --- a/resources/views/admin/data-management/roles/create.blade.php +++ b/resources/views/admin/data-management/roles/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Add new role

    @@ -10,19 +10,7 @@ {!! Form::open(['url' => 'admin/data-management/roles', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('role', 'Role: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('role', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('role', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.roles._form', ['submitText' => 'Add']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/roles/edit.blade.php b/resources/views/admin/data-management/roles/edit.blade.php index 1e4fc977..fb7b7fc0 100644 --- a/resources/views/admin/data-management/roles/edit.blade.php +++ b/resources/views/admin/data-management/roles/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Edit role

    @@ -14,19 +14,7 @@ 'class' => 'form-horizontal' ]) !!} -
    - {!! Form::label('role', 'Role: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('role', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('role', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.roles._form', ['submitText' => 'Update']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/roles/index.blade.php b/resources/views/admin/data-management/roles/index.blade.php index 784ecded..0497000d 100644 --- a/resources/views/admin/data-management/roles/index.blade.php +++ b/resources/views/admin/data-management/roles/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Roles New @@ -20,7 +20,7 @@ - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/roles', $role->id], @@ -40,6 +40,6 @@ @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/roles/show.blade.php b/resources/views/admin/data-management/roles/show.blade.php index d9000a18..c2ccbc87 100644 --- a/resources/views/admin/data-management/roles/show.blade.php +++ b/resources/views/admin/data-management/roles/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Role

    diff --git a/resources/views/admin/data-management/seasons/_form.blade.php b/resources/views/admin/data-management/seasons/_form.blade.php new file mode 100644 index 00000000..9e945564 --- /dev/null +++ b/resources/views/admin/data-management/seasons/_form.blade.php @@ -0,0 +1,13 @@ +
    + {!! Form::label('season', 'Season: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::text('season', null, ['class' => 'form-control', 'required' => true, 'autofocus' => true]) !!} + {!! $errors->first('season', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    \ No newline at end of file diff --git a/resources/views/admin/data-management/seasons/create.blade.php b/resources/views/admin/data-management/seasons/create.blade.php index 0f20d75a..36cb8221 100644 --- a/resources/views/admin/data-management/seasons/create.blade.php +++ b/resources/views/admin/data-management/seasons/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Add a new season

    @@ -10,19 +10,7 @@ {!! Form::open(['url' => 'admin/data-management/seasons', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('season', 'Season: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('season', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('season', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.seasons._form', ['submitText' => 'Add']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/seasons/edit.blade.php b/resources/views/admin/data-management/seasons/edit.blade.php index 8c227309..06d1da02 100644 --- a/resources/views/admin/data-management/seasons/edit.blade.php +++ b/resources/views/admin/data-management/seasons/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Edit season

    @@ -14,19 +14,7 @@ 'class' => 'form-horizontal' ]) !!} -
    - {!! Form::label('season', 'Season: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('season', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('season', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.seasons._form', ['submitText' => 'Update']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/seasons/index.blade.php b/resources/views/admin/data-management/seasons/index.blade.php index 0245749c..ac50aaed 100644 --- a/resources/views/admin/data-management/seasons/index.blade.php +++ b/resources/views/admin/data-management/seasons/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Seasons New @@ -19,7 +19,7 @@ - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/seasons', $season->id], @@ -39,6 +39,6 @@ @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/seasons/show.blade.php b/resources/views/admin/data-management/seasons/show.blade.php index 81638f3e..b12c4e5b 100644 --- a/resources/views/admin/data-management/seasons/show.blade.php +++ b/resources/views/admin/data-management/seasons/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Season

    diff --git a/resources/views/admin/data-management/teams/_form.blade.php b/resources/views/admin/data-management/teams/_form.blade.php new file mode 100644 index 00000000..8edb64c1 --- /dev/null +++ b/resources/views/admin/data-management/teams/_form.blade.php @@ -0,0 +1,21 @@ +
    + {!! Form::label('club_id', 'Club Id: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::select('club_id', array_column($clubs->toArray(), 'club', 'id'), null, ['class' => 'form-control']) !!} + {!! $errors->first('club_id', '

    :message

    ') !!} +
    +
    + +
    + {!! Form::label('team', 'Team: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::text('team', null, ['class' => 'form-control', 'required' => true, 'autofocus' => true]) !!} + {!! $errors->first('team', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    \ No newline at end of file diff --git a/resources/views/admin/data-management/teams/create.blade.php b/resources/views/admin/data-management/teams/create.blade.php index 56ae0a07..e729f3cc 100644 --- a/resources/views/admin/data-management/teams/create.blade.php +++ b/resources/views/admin/data-management/teams/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Add new team

    @@ -10,27 +10,7 @@ {!! Form::open(['url' => 'admin/data-management/teams', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('club_id', 'Club: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('club_id', array_column($clubs->toArray(), 'club', 'id'), null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('club_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('team', 'Team: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('team', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('team', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.teams._form', ['submitText' => 'Add']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/teams/edit.blade.php b/resources/views/admin/data-management/teams/edit.blade.php index b7060454..6d5d4702 100644 --- a/resources/views/admin/data-management/teams/edit.blade.php +++ b/resources/views/admin/data-management/teams/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Edit team

    @@ -14,27 +14,7 @@ 'class' => 'form-horizontal' ]) !!} -
    - {!! Form::label('club_id', 'Club Id: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::select('club_id', array_column($clubs->toArray(), 'club', 'id'), $team->club->id, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('club_id', '

    :message

    ') !!} -
    -
    - -
    - {!! Form::label('team', 'Team: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('team', null, ['class' => 'form-control', 'required' => 'required']) !!} - {!! $errors->first('team', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.teams._form', ['submitText' => 'Update']) {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/teams/index.blade.php b/resources/views/admin/data-management/teams/index.blade.php index 97fd3854..763b59fc 100644 --- a/resources/views/admin/data-management/teams/index.blade.php +++ b/resources/views/admin/data-management/teams/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Teams New @@ -22,7 +22,7 @@ - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/teams', $team->id], @@ -42,6 +42,6 @@ @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/teams/show.blade.php b/resources/views/admin/data-management/teams/show.blade.php index a88c1f4b..3e47bdba 100644 --- a/resources/views/admin/data-management/teams/show.blade.php +++ b/resources/views/admin/data-management/teams/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Team

    diff --git a/resources/views/admin/data-management/venues/_form.blade.php b/resources/views/admin/data-management/venues/_form.blade.php new file mode 100644 index 00000000..d2ad3dc0 --- /dev/null +++ b/resources/views/admin/data-management/venues/_form.blade.php @@ -0,0 +1,13 @@ +
    + {!! Form::label('venue', 'Venue: ', ['class' => 'col-sm-3 control-label']) !!} +
    + {!! Form::text('venue', null, ['class' => 'form-control', 'required' => true, 'autofocus' => true]) !!} + {!! $errors->first('venue', '

    :message

    ') !!} +
    +
    + +
    +
    + {!! Form::submit($submitText, ['class' => 'btn btn-primary form-control']) !!} +
    +
    diff --git a/resources/views/admin/data-management/venues/create.blade.php b/resources/views/admin/data-management/venues/create.blade.php index ce3dd765..80399790 100644 --- a/resources/views/admin/data-management/venues/create.blade.php +++ b/resources/views/admin/data-management/venues/create.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Add new venue

    @@ -10,19 +10,7 @@ {!! Form::open(['url' => 'admin/data-management/venues', 'class' => 'form-horizontal']) !!} -
    - {!! Form::label('venue', 'Venue: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('venue', null, ['class' => 'form-control']) !!} - {!! $errors->first('venue', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Add', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.venues._form', ['submitText' => 'Add']); {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/venues/edit.blade.php b/resources/views/admin/data-management/venues/edit.blade.php index e9876621..ef0582a9 100644 --- a/resources/views/admin/data-management/venues/edit.blade.php +++ b/resources/views/admin/data-management/venues/edit.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Edit venue

    @@ -14,19 +14,7 @@ 'class' => 'form-horizontal' ]) !!} -
    - {!! Form::label('venue', 'Venue: ', ['class' => 'col-sm-3 control-label']) !!} -
    - {!! Form::text('venue', null, ['class' => 'form-control']) !!} - {!! $errors->first('venue', '

    :message

    ') !!} -
    -
    - -
    -
    - {!! Form::submit('Update', ['class' => 'btn btn-primary form-control']) !!} -
    -
    + @include('admin.data-management.venues._form', ['submitText' => 'Update']); {!! Form::close() !!}
    diff --git a/resources/views/admin/data-management/venues/index.blade.php b/resources/views/admin/data-management/venues/index.blade.php index 10973773..d51bb656 100644 --- a/resources/views/admin/data-management/venues/index.blade.php +++ b/resources/views/admin/data-management/venues/index.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Venues New @@ -20,7 +20,7 @@ - / + {!! Form::open([ 'method'=>'DELETE', 'url' => ['admin/data-management/venues', $venue->id], @@ -40,6 +40,6 @@ @endsection @section('javascript') - + @endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/venues/show.blade.php b/resources/views/admin/data-management/venues/show.blade.php index aa173cc3..71b147cd 100644 --- a/resources/views/admin/data-management/venues/show.blade.php +++ b/resources/views/admin/data-management/venues/show.blade.php @@ -1,6 +1,6 @@ -@extends('admin.data-management.home') +@extends('layouts.app') -@section('crud') +@section('content')

    Venue

    diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index e6bb1896..f2308d6f 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -51,7 +51,7 @@
    Forgot Your Password? diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 8009c6a7..399b2070 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -34,7 +34,7 @@
    diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index 70580f00..599824e7 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -57,7 +57,7 @@
    diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 15e6cd52..83e91340 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -69,7 +69,7 @@
    diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 1fd4a44a..ca814d8a 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -15,6 +15,7 @@ + @yield('stylesheets')