-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
717 additions
and
28 deletions.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
app/Http/Controllers/Admin/DataManagement/ClubsController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
115
app/Http/Controllers/Admin/DataManagement/VenuesController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.