-
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.
fix the batches cannot created without design and the users list
- Loading branch information
1 parent
4e17037
commit f7f3c6a
Showing
6 changed files
with
111 additions
and
6 deletions.
There are no files selected for viewing
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,29 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use App\User; | ||
|
||
class UserController extends Controller | ||
{ | ||
public function __construct() | ||
{ | ||
$this->middleware(['auth', 'auth.admin']); | ||
} | ||
|
||
public function index() | ||
{ | ||
$users = User::paginate(5); | ||
return view('user-all', compact('users')); | ||
} | ||
|
||
public function updateAccess($id) | ||
{ | ||
$user = User::find($id); | ||
$user->have_access = $user->have_access ? false : true; | ||
$user->save(); | ||
|
||
return back(); | ||
} | ||
} |
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,59 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading">All Users</div> | ||
|
||
<div class="panel-body table-responsive"> | ||
@if (session('status')) | ||
<div class="alert alert-success"> | ||
{{ session('status') }} | ||
</div> | ||
@endif | ||
|
||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th>Access</th> | ||
<th>Created At</th> | ||
<th>Updated At</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
@foreach($users as $user) | ||
<tr> | ||
<td>#{{$user->id}}</td> | ||
<td>{{$user->name}}</td> | ||
<td>{{$user->email}}</td> | ||
<td>{{$user->have_access ? 'Yes' : 'No'}}</td> | ||
<td>{{$user->created_at}}</td> | ||
<td>{{$user->updated_at}}</td> | ||
<td> | ||
{!! Form::open(['url' => "/users/{$user->id}/update-access"]) !!} | ||
<button type="submit" class="btn btn-default"> | ||
<span class="glyphicon {{ $user->have_access ? 'glyphicon-remove' : 'glyphicon-ok'}}" aria-hidden="true"></span> | ||
</button> | ||
|
||
{!! Form::close() !!} | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
{{ $users->links() }} | ||
<hr> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
@endsection |
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