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/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 38d19288..db66c022 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,40 @@ 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'); +}); + +// 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 16fabb1d..b7a4e792 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -58,6 +58,8 @@ 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'); + Route::resource('venues', 'VenuesController'); }); }); }); 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/database/migrations/2016_04_12_200052_create_venues_table.php b/database/migrations/2016_04_12_200052_create_venues_table.php new file mode 100644 index 00000000..deb27278 --- /dev/null +++ b/database/migrations/2016_04_12_200052_create_venues_table.php @@ -0,0 +1,37 @@ +engine = 'InnoDB'; + + $table->increments('id'); + $table->string('venue'); + + $table->timestamps(); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('venues'); + } + +} 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... 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}}'); } 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()) + + @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()) + + @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..e2352ddc 100644 --- a/resources/views/admin/data-management/home.blade.php +++ b/resources/views/admin/data-management/home.blade.php @@ -5,6 +5,8 @@
Seasons + Clubs + Venues
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()) + + @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()) + + @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