Exemple #1
0
<?php

Route::bind('user', function ($id) {
    return App\User::whereId($id)->first();
});
Route::bind('student', function ($id) {
    return App\Student::whereStudentId($id)->first();
});
Route::bind('role', function ($id) {
    return App\Role::whereId($id)->first();
});
Route::bind('information', function ($id) {
    return App\Information::whereId($id)->first();
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
Route::get('home', ['as' => 'home', 'uses' => 'HomeController@index']);
// AUTH CONTROLLERS
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
// USER
Route::resource('user', 'UserController');
post('update/{user_id}/role', ['as' => 'update_role', 'uses' => 'UserController@updateRoles']);
						</tr>
						@foreach($teams as $team)
						<tr>
							<td><a href="{{route('teams.edit', $team->id)}}"> {{$team -> name }}</a></td>
							<td>
								@if($team->status=='1')
								<span style="color:green">{{'Active'}}</span>
								@else
								<span style="color:red">{{'Inactive'}}</span>
								@endif

<?php 
if ($team->team_lead == 0) {
    $team_lead = "";
} else {
    $users = App\User::whereId($team->team_lead)->first();
    $team_lead = $users->first_name . " " . $users->last_name;
}
?>
							<td>{{count($assign_team_agent->where('team_id',$team->id))}}</td>
							<td>{{ $team_lead }}</td>
							<td>
							{!! Form::open(['route'=>['teams.destroy', $team->id],'method'=>'DELETE']) !!}
							<!-- To pop up a confirm Message -->
							<a href="{{route('teams.edit', $team->id)}}" class="btn btn-info btn-xs btn-flat"><i class="fa fa-edit" style="color:black;"> </i> Edit</a>
								{!! Form::button('<i class="fa fa-trash" style="color:black;"> </i> Delete',
				            		['type' => 'submit',
				            		'class'=> 'btn btn-warning btn-xs btn-flat',
				            		'onclick'=>'return confirm("Are you sure?")'])
				            	!!}
							{!! Form::close() !!}
Exemple #3
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
Route::get('home', 'HomeController@index');
Route::resource('/contact', 'HomeController@contact');
route::resource('user', 'UsersController');
Route::get('profile', 'UsersController@showProfile');
Route::bind('users', function ($value, $route) {
    return App\User::whereId($value)->first();
});
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
$disable = '';
?>
							@endif
							</a></td>
							<td>
								@if($department->type=='1')
								<span style="color:green">{{'Public'}}</span>
								@else
								<span style="color:red">{{'Private'}}</span>
								@endif
							</td>
								<?php 
if ($department->manager == 0) {
    $manager = "";
} else {
    $manager = App\User::whereId($department->manager)->first();
    $manager = $manager->user_name;
}
if ($department->sla == null) {
    $sla = "";
} else {
    $sla = App\Model\helpdesk\Manage\Sla_plan::whereId($department->sla)->first();
    $sla = $sla->grace_period;
}
?>

							<td>{{ $sla }}</td>
							<td>{{ $manager }}</td>
							<td>
							{!! Form::open(['route'=>['departments.destroy', $department->id],'method'=>'DELETE']) !!}
							<a href="{{route('departments.edit', $department->id)}}" class="btn btn-info btn-xs btn-flat"><i class="fa fa-edit" style="color:black;"> </i> Edit</a>