Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
troccoli committed Apr 12, 2016
2 parents c7e39e7 + 4ea489e commit 3859dd1
Show file tree
Hide file tree
Showing 21 changed files with 717 additions and 28 deletions.
115 changes: 115 additions & 0 deletions app/Http/Controllers/Admin/DataManagement/ClubsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

namespace App\Http\Controllers\Admin\DataManagement;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Models\Club;
use Illuminate\Http\Request;
use Carbon\Carbon;
use Session;

class ClubsController extends Controller
{

/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$clubs = Club::paginate(15);

return view('admin.data-management.clubs.index', compact('clubs'));
}

/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return view('admin.data-management.clubs.create');
}

/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(Request $request)
{

Club::create($request->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');
}

}
115 changes: 115 additions & 0 deletions app/Http/Controllers/Admin/DataManagement/VenuesController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

namespace App\Http\Controllers\Admin\DataManagement;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Models\Venue;
use Illuminate\Http\Request;
use Carbon\Carbon;
use Session;

class VenuesController extends Controller
{

/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$venues = Venue::paginate(15);

return view('admin.data-management.venues.index', compact('venues'));
}

/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return view('admin.data-management.venues.create');
}

/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(Request $request)
{

Venue::create($request->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');
}

}
37 changes: 37 additions & 0 deletions app/Http/breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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');
});
2 changes: 2 additions & 0 deletions app/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
});
24 changes: 24 additions & 0 deletions app/Models/Club.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Club extends Model
{

/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'clubs';

/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['club'];

}
24 changes: 24 additions & 0 deletions app/Models/Venue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Venue extends Model
{

/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'venues';

/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['venue'];

}
9 changes: 9 additions & 0 deletions database/deployment/2016_04_12.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE `clubs` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`club` VARCHAR(255) NOT NULL,
`created_at` TIMESTAMP NULL,
`updated_at` TIMESTAMP NULL
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
ENGINE = InnoDB;
9 changes: 9 additions & 0 deletions database/deployment/2016_04_12_b.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE `venues` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`venue` VARCHAR(255) NOT NULL,
`created_at` TIMESTAMP NULL,
`updated_at` TIMESTAMP NULL
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
ENGINE = InnoDB;
Loading

0 comments on commit 3859dd1

Please sign in to comment.