blacklist features
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Corps;
|
||||
namespace App\Http\Controllers\Blacklist;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Http\Request;
|
||||
@@ -12,6 +12,9 @@ use App\Library\Lookups\NewLookupHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\Character\BlacklistUser;
|
||||
use App\Models\User\User;
|
||||
use App\Models\User\UserRole;
|
||||
use App\Models\User\UserPermission;
|
||||
|
||||
class BlacklistController extends Controller
|
||||
{
|
||||
@@ -48,6 +51,8 @@ class BlacklistController extends Controller
|
||||
'character_id' => $charId,
|
||||
'name' => $request->name,
|
||||
'reason' => $request->reason,
|
||||
'lister_id' => auth()->user()->getId(),
|
||||
'lister_name' => auth()->user()->getName(),
|
||||
]);
|
||||
} else {
|
||||
//Return the view
|
||||
@@ -77,19 +82,15 @@ class BlacklistController extends Controller
|
||||
}
|
||||
|
||||
public function DisplayBlacklist() {
|
||||
//Middleware needed
|
||||
$this->middleware('permission:corp.recruiter');
|
||||
|
||||
//Get the entire blacklist
|
||||
$blacklist = BlacklistUser::all();
|
||||
$blacklist = BlacklistUser::all()->paginate(50);
|
||||
|
||||
//Return the view with the data
|
||||
return view('blacklist.list')->with('blacklist', $blacklist);
|
||||
}
|
||||
|
||||
public function SearchInBlacklist(Request $request) {
|
||||
//Middleware needed
|
||||
$this->middleware('permission:corp.recruiter');
|
||||
|
||||
//Validate the input from the form
|
||||
$this->validate($request, [
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Character;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CharacterClone extends Model
|
||||
{
|
||||
// Table Name
|
||||
public $table = 'clones';
|
||||
|
||||
// Timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'character_id',
|
||||
'active',
|
||||
];
|
||||
}
|
||||
@@ -19,6 +19,8 @@ class CreateBlacklistTable extends Migration
|
||||
$table->string('character_id')->unique();
|
||||
$table->string('name')->unique();
|
||||
$table->text('reason');
|
||||
$table->string('lister_id');
|
||||
$table->string('lister_name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,4 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($blacklist != null)
|
||||
{{ $blacklist->links() }}
|
||||
@endif
|
||||
@endsection
|
||||
@@ -86,6 +86,19 @@
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
@if(auth()->user()->hasRole('User') || auth()->user()->hasRole('Admin'))
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Others</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropDownMenuLink">
|
||||
<a class="dropdown-item" href="/blacklist/display">Display</a>
|
||||
<a class="dropdown-item" href="/blacklist/search">Search</a>
|
||||
@if(auth()->user()->hasPermission('alliance.recruiter'))
|
||||
<a class="dropdown-item" href="/blacklist/add">Add To</a>
|
||||
<a class="dropdown-item" href="/blacklist/remove">Remove From</a>
|
||||
@endif
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
<ul class="navbar-nav m1-auto">
|
||||
<li class="nav-item">
|
||||
|
||||
@@ -53,10 +53,10 @@ Route::group(['middleware' => ['auth']], function(){
|
||||
/**
|
||||
* Blacklist Controller display pages
|
||||
*/
|
||||
Route::get('/blacklist/display', 'Corps\BlacklistController@DisplayBlacklist');
|
||||
Route::post('/blacklist/add', 'Corps\BlacklistController@AddToBlacklist');
|
||||
Route::post('/blacklist/remove', 'Corps\BlacklistController@RemoveFromBlacklist');
|
||||
Route::post('/blacklist/search', 'Corps\BlacklistController@SearchInBlacklist');
|
||||
Route::get('/blacklist/display', 'Blacklist\BlacklistController@DisplayBlacklist');
|
||||
Route::post('/blacklist/add', 'Blacklist\BlacklistController@AddToBlacklist');
|
||||
Route::post('/blacklist/remove', 'Blacklist\BlacklistController@RemoveFromBlacklist');
|
||||
Route::post('/blacklist/search', 'Blacklist\BlacklistController@SearchInBlacklist');
|
||||
|
||||
/**
|
||||
* Contract Controller display pages
|
||||
|
||||
Reference in New Issue
Block a user