From 49db7413380075cbd2d071df84cc7eec9f16a816 Mon Sep 17 00:00:00 2001 From: Giulio Date: Thu, 7 Apr 2016 16:09:37 +0100 Subject: [PATCH 1/4] Cleared readme.md as it was the default Laravel's one --- readme.md | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/readme.md b/readme.md index 8f1a9496..4318a847 100644 --- a/readme.md +++ b/readme.md @@ -1,27 +1 @@ -# Laravel PHP Framework - -[![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) -[![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework) -[![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework) -[![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework) -[![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) - -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching. - -Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. - -## Official Documentation - -Documentation for the framework can be found on the [Laravel website](http://laravel.com/docs). - -## Contributing - -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions). - -## Security Vulnerabilities - -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. - -## License - -The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) +To be continued... From 8d47b247c5f6f69bbec63c5c6ab3de3b98504fda Mon Sep 17 00:00:00 2001 From: Giulio Troccoli Date: Tue, 12 Apr 2016 19:57:47 +0100 Subject: [PATCH 2/4] lva-4: Fixed an error in the controller's stub for the crud generator --- resources/crud-generator/controller.stub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/crud-generator/controller.stub b/resources/crud-generator/controller.stub index 4ac33469..97263d14 100644 --- a/resources/crud-generator/controller.stub +++ b/resources/crud-generator/controller.stub @@ -45,7 +45,7 @@ class DummyClass extends Controller {{validationRules}} {{modelName}}::create($request->all()); - Flass::success({{modelName}} added!'); + Flass::success(''{{modelName}} added!'); return redirect('{{routeGroup}}{{crudName}}'); } From 0f7089786c49a4566e694808f8760f83415f1544 Mon Sep 17 00:00:00 2001 From: Giulio Troccoli Date: Tue, 12 Apr 2016 19:58:16 +0100 Subject: [PATCH 3/4] lva-4: Added CRUD for the Clubs table --- .../Admin/DataManagement/ClubsController.php | 115 ++++++++++++++++++ app/Http/breadcrumbs.php | 18 +++ app/Http/routes.php | 1 + app/Models/Club.php | 24 ++++ database/deployment/2016_04_12.sql | 9 ++ .../2016_04_12_194551_create_clubs_table.php | 37 ++++++ .../data-management/clubs/create.blade.php | 43 +++++++ .../data-management/clubs/edit.blade.php | 47 +++++++ .../data-management/clubs/index.blade.php | 46 +++++++ .../data-management/clubs/show.blade.php | 23 ++++ .../admin/data-management/home.blade.php | 1 + 11 files changed, 364 insertions(+) create mode 100644 app/Http/Controllers/Admin/DataManagement/ClubsController.php create mode 100644 app/Models/Club.php create mode 100644 database/deployment/2016_04_12.sql create mode 100644 database/migrations/2016_04_12_194551_create_clubs_table.php create mode 100644 resources/views/admin/data-management/clubs/create.blade.php create mode 100644 resources/views/admin/data-management/clubs/edit.blade.php create mode 100644 resources/views/admin/data-management/clubs/index.blade.php create mode 100644 resources/views/admin/data-management/clubs/show.blade.php diff --git a/app/Http/Controllers/Admin/DataManagement/ClubsController.php b/app/Http/Controllers/Admin/DataManagement/ClubsController.php new file mode 100644 index 00000000..b3692c07 --- /dev/null +++ b/app/Http/Controllers/Admin/DataManagement/ClubsController.php @@ -0,0 +1,115 @@ +all()); + + Flass::success('Club added!'); + + return redirect('admin/data-management/clubs'); + } + + /** + * Display the specified resource. + * + * @param int $id + * + * @return Response + */ + public function show($id) + { + $club = Club::findOrFail($id); + + return view('admin.data-management.clubs.show', compact('club')); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * + * @return Response + */ + public function edit($id) + { + $club = Club::findOrFail($id); + + return view('admin.data-management.clubs.edit', compact('club')); + } + + /** + * Update the specified resource in storage. + * + * @param int $id + * + * @return Response + */ + public function update($id, Request $request) + { + + $club = Club::findOrFail($id); + $club->update($request->all()); + + Flash::success('Club updated!'); + + return redirect('admin/data-management/clubs'); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * + * @return Response + */ + public function destroy($id) + { + Club::destroy($id); + + Flash::success('Club deleted!'); + + return redirect('admin/data-management/clubs'); + } + +} diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index 38d19288..cb0ccfc9 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -33,6 +33,7 @@ $b->push('Data Management', route('admin::dataManagement')); }); +// Data Management - Seasons Breadcrumbs::register('admin.data-management.seasons.index', function($b) { $b->parent('admin::dataManagement'); $b->push('Seasons', route('admin.data-management.seasons.index')); @@ -48,4 +49,21 @@ Breadcrumbs::register('admin.data-management.seasons.show', function($b) { $b->parent('admin.data-management.seasons.index'); $b->push('View'); +}); +// Data Management - Clubs +Breadcrumbs::register('admin.data-management.clubs.index', function($b) { + $b->parent('admin::dataManagement'); + $b->push('Clubs', route('admin.data-management.clubs.index')); +}); +Breadcrumbs::register('admin.data-management.clubs.create', function($b) { + $b->parent('admin.data-management.clubs.index'); + $b->push('Add', route('admin.data-management.clubs.create')); +}); +Breadcrumbs::register('admin.data-management.clubs.edit', function($b) { + $b->parent('admin.data-management.clubs.index'); + $b->push('Edit'); +}); +Breadcrumbs::register('admin.data-management.clubs.show', function($b) { + $b->parent('admin.data-management.clubs.index'); + $b->push('View'); }); \ No newline at end of file diff --git a/app/Http/routes.php b/app/Http/routes.php index 16fabb1d..e3b48ecd 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -58,6 +58,7 @@ Route::get('data-management', ['as' => 'admin::dataManagement', 'uses' => 'DataManagementController@showHome']); Route::group(['prefix' => 'data-management', 'namespace' => 'DataManagement'], function () { Route::resource('seasons', 'SeasonsController'); + Route::resource('clubs', 'ClubsController'); }); }); }); diff --git a/app/Models/Club.php b/app/Models/Club.php new file mode 100644 index 00000000..a1caf6ad --- /dev/null +++ b/app/Models/Club.php @@ -0,0 +1,24 @@ +engine = 'InnoDB'; + + $table->increments('id'); + $table->string('club'); + + $table->timestamps(); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('clubs'); + } + +} diff --git a/resources/views/admin/data-management/clubs/create.blade.php b/resources/views/admin/data-management/clubs/create.blade.php new file mode 100644 index 00000000..16f90442 --- /dev/null +++ b/resources/views/admin/data-management/clubs/create.blade.php @@ -0,0 +1,43 @@ +@extends('layouts.app') + +@section('content') + +
+

Create New Club

+
+ + {!! Form::open(['url' => 'admin/data-management/clubs', 'class' => 'form-horizontal']) !!} + +
+ {!! Form::label('id', 'Id: ', ['class' => 'col-sm-3 control-label']) !!} +
+ {!! Form::number('id', null, ['class' => 'form-control']) !!} + {!! $errors->first('id', '

:message

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

:message

') !!} +
+
+ + +
+
+ {!! Form::submit('Create', ['class' => 'btn btn-primary form-control']) !!} +
+
+ {!! Form::close() !!} + + @if ($errors->any()) +
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+ @endif +
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/clubs/edit.blade.php b/resources/views/admin/data-management/clubs/edit.blade.php new file mode 100644 index 00000000..62126607 --- /dev/null +++ b/resources/views/admin/data-management/clubs/edit.blade.php @@ -0,0 +1,47 @@ +@extends('layouts.app') + +@section('content') + +
+

Edit Club

+
+ + {!! Form::model($club, [ + 'method' => 'PATCH', + 'url' => ['admin/data-management/clubs', $club->id], + 'class' => 'form-horizontal' + ]) !!} + +
+ {!! Form::label('id', 'Id: ', ['class' => 'col-sm-3 control-label']) !!} +
+ {!! Form::number('id', null, ['class' => 'form-control']) !!} + {!! $errors->first('id', '

:message

') !!} +
+
+
+ {!! 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']) !!} +
+
+ {!! Form::close() !!} + + @if ($errors->any()) +
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+ @endif +
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/clubs/index.blade.php b/resources/views/admin/data-management/clubs/index.blade.php new file mode 100644 index 00000000..509facd5 --- /dev/null +++ b/resources/views/admin/data-management/clubs/index.blade.php @@ -0,0 +1,46 @@ +@extends('layouts.app') + +@section('content') + +
+

Clubs Add New Club

+
+ + + + + + + + {{-- */$x=0;/* --}} + @foreach($clubs as $item) + {{-- */$x++;/* --}} + + + + + + @endforeach + +
S.NoIdClubActions
{{ $x }}{{ $item->id }}{{ $item->club }} + + + / + {!! Form::open([ + 'method'=>'DELETE', + 'url' => ['admin/data-management/clubs', $item->id], + 'style' => 'display:inline' + ]) !!} + {!! Form::submit('Delete', ['class' => 'btn btn-danger btn-xs', 'data-toggle' => 'confirmation']) !!} + {!! Form::close() !!} +
+ +
+
+ +@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 new file mode 100644 index 00000000..d56c3137 --- /dev/null +++ b/resources/views/admin/data-management/clubs/show.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') + +@section('content') + +
+

Club

+
+ + + + + + + + + + + +
ID. IdClub
{{ $club->id }} {{ $club->id }} {{ $club->club }}
+
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/home.blade.php b/resources/views/admin/data-management/home.blade.php index 1e14a490..6fd63930 100644 --- a/resources/views/admin/data-management/home.blade.php +++ b/resources/views/admin/data-management/home.blade.php @@ -5,6 +5,7 @@ From 9f068bf6704453e67602fac2dac0cee8c87d5105 Mon Sep 17 00:00:00 2001 From: Giulio Troccoli Date: Tue, 12 Apr 2016 20:07:37 +0100 Subject: [PATCH 4/4] lva-5: Added CRUD for the Venues table --- .../Admin/DataManagement/VenuesController.php | 115 ++++++++++++++++++ app/Http/breadcrumbs.php | 19 +++ app/Http/routes.php | 1 + app/Models/Venue.php | 24 ++++ database/deployment/2016_04_12_b.sql | 9 ++ .../2016_04_12_200052_create_venues_table.php | 37 ++++++ .../admin/data-management/home.blade.php | 1 + .../data-management/venues/create.blade.php | 36 ++++++ .../data-management/venues/edit.blade.php | 40 ++++++ .../data-management/venues/index.blade.php | 46 +++++++ .../data-management/venues/show.blade.php | 23 ++++ 11 files changed, 351 insertions(+) create mode 100644 app/Http/Controllers/Admin/DataManagement/VenuesController.php create mode 100644 app/Models/Venue.php create mode 100644 database/deployment/2016_04_12_b.sql create mode 100644 database/migrations/2016_04_12_200052_create_venues_table.php create mode 100644 resources/views/admin/data-management/venues/create.blade.php create mode 100644 resources/views/admin/data-management/venues/edit.blade.php create mode 100644 resources/views/admin/data-management/venues/index.blade.php create mode 100644 resources/views/admin/data-management/venues/show.blade.php diff --git a/app/Http/Controllers/Admin/DataManagement/VenuesController.php b/app/Http/Controllers/Admin/DataManagement/VenuesController.php new file mode 100644 index 00000000..246b7cd0 --- /dev/null +++ b/app/Http/Controllers/Admin/DataManagement/VenuesController.php @@ -0,0 +1,115 @@ +all()); + + Flass::success('Venue added!'); + + return redirect('admin/data-management/venues'); + } + + /** + * Display the specified resource. + * + * @param int $id + * + * @return Response + */ + public function show($id) + { + $venue = Venue::findOrFail($id); + + return view('admin.data-management.venues.show', compact('venue')); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * + * @return Response + */ + public function edit($id) + { + $venue = Venue::findOrFail($id); + + return view('admin.data-management.venues.edit', compact('venue')); + } + + /** + * Update the specified resource in storage. + * + * @param int $id + * + * @return Response + */ + public function update($id, Request $request) + { + + $venue = Venue::findOrFail($id); + $venue->update($request->all()); + + Flash::success('Venue updated!'); + + return redirect('admin/data-management/venues'); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * + * @return Response + */ + public function destroy($id) + { + Venue::destroy($id); + + Flash::success('Venue deleted!'); + + return redirect('admin/data-management/venues'); + } + +} diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index cb0ccfc9..db66c022 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -50,6 +50,7 @@ $b->parent('admin.data-management.seasons.index'); $b->push('View'); }); + // Data Management - Clubs Breadcrumbs::register('admin.data-management.clubs.index', function($b) { $b->parent('admin::dataManagement'); @@ -66,4 +67,22 @@ Breadcrumbs::register('admin.data-management.clubs.show', function($b) { $b->parent('admin.data-management.clubs.index'); $b->push('View'); +}); + +// Data Management - Venues +Breadcrumbs::register('admin.data-management.venues.index', function($b) { + $b->parent('admin::dataManagement'); + $b->push('Venues', route('admin.data-management.venues.index')); +}); +Breadcrumbs::register('admin.data-management.venues.create', function($b) { + $b->parent('admin.data-management.venues.index'); + $b->push('Add', route('admin.data-management.venues.create')); +}); +Breadcrumbs::register('admin.data-management.venues.edit', function($b) { + $b->parent('admin.data-management.venues.index'); + $b->push('Edit'); +}); +Breadcrumbs::register('admin.data-management.venues.show', function($b) { + $b->parent('admin.data-management.venues.index'); + $b->push('View'); }); \ No newline at end of file diff --git a/app/Http/routes.php b/app/Http/routes.php index e3b48ecd..b7a4e792 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -59,6 +59,7 @@ Route::group(['prefix' => 'data-management', 'namespace' => 'DataManagement'], function () { Route::resource('seasons', 'SeasonsController'); Route::resource('clubs', 'ClubsController'); + Route::resource('venues', 'VenuesController'); }); }); }); diff --git a/app/Models/Venue.php b/app/Models/Venue.php new file mode 100644 index 00000000..50082868 --- /dev/null +++ b/app/Models/Venue.php @@ -0,0 +1,24 @@ +engine = 'InnoDB'; + + $table->increments('id'); + $table->string('venue'); + + $table->timestamps(); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('venues'); + } + +} diff --git a/resources/views/admin/data-management/home.blade.php b/resources/views/admin/data-management/home.blade.php index 6fd63930..e2352ddc 100644 --- a/resources/views/admin/data-management/home.blade.php +++ b/resources/views/admin/data-management/home.blade.php @@ -6,6 +6,7 @@ diff --git a/resources/views/admin/data-management/venues/create.blade.php b/resources/views/admin/data-management/venues/create.blade.php new file mode 100644 index 00000000..223f24ff --- /dev/null +++ b/resources/views/admin/data-management/venues/create.blade.php @@ -0,0 +1,36 @@ +@extends('layouts.app') + +@section('content') + +
+

Create New Venue

+
+ + {!! 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('Create', ['class' => 'btn btn-primary form-control']) !!} +
+
+ {!! Form::close() !!} + + @if ($errors->any()) +
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+ @endif +
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/venues/edit.blade.php b/resources/views/admin/data-management/venues/edit.blade.php new file mode 100644 index 00000000..67904976 --- /dev/null +++ b/resources/views/admin/data-management/venues/edit.blade.php @@ -0,0 +1,40 @@ +@extends('layouts.app') + +@section('content') + +
+

Edit Venue

+
+ + {!! Form::model($venue, [ + 'method' => 'PATCH', + 'url' => ['admin/data-management/venues', $venue->id], + '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']) !!} +
+
+ {!! Form::close() !!} + + @if ($errors->any()) +
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+ @endif +
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/data-management/venues/index.blade.php b/resources/views/admin/data-management/venues/index.blade.php new file mode 100644 index 00000000..f6f67c15 --- /dev/null +++ b/resources/views/admin/data-management/venues/index.blade.php @@ -0,0 +1,46 @@ +@extends('layouts.app') + +@section('content') + +
+

Venues Add New Venue

+
+ + + + + + + + {{-- */$x=0;/* --}} + @foreach($venues as $item) + {{-- */$x++;/* --}} + + + + + + @endforeach + +
S.NoVenueActions
{{ $x }}{{ $item->venue }} + + + / + {!! Form::open([ + 'method'=>'DELETE', + 'url' => ['admin/data-management/venues', $item->id], + 'style' => 'display:inline' + ]) !!} + {!! Form::submit('Delete', ['class' => 'btn btn-danger btn-xs', 'data-toggle' => 'confirmation']) !!} + {!! Form::close() !!} +
+ +
+
+ +@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 new file mode 100644 index 00000000..06979660 --- /dev/null +++ b/resources/views/admin/data-management/venues/show.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') + +@section('content') + +
+

Venue

+
+ + + + + + + + + + + +
ID. Venue
{{ $venue->id }} {{ $venue->venue }}
+
+
+ +@endsection \ No newline at end of file