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') + +
:message
') !!} +:message
') !!} +:message
') !!} +:message
') !!} +S.No | Id | Club | Actions | +
---|---|---|---|
{{ $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() !!} + | +
ID. | Id | Club | +
---|---|---|
{{ $club->id }} | {{ $club->id }} | {{ $club->club }} | +
:message
') !!} +:message
') !!} +S.No | Venue | Actions | +
---|---|---|
{{ $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() !!} + | +
ID. | Venue | +
---|---|
{{ $venue->id }} | {{ $venue->venue }} | +