Route::get('/', function () {
    /*
     # Polymorphic Relationship Example
     # Photo, Staff, Order Models
     #
    */
    $photo = App\Photo::find(3);
    /* You Can Check ID [ 1,2,3,4 ] */
    $imageable = $photo->imageable;
    return $imageable;
});
Route::get('/many-to-many-polymorphic', function () {
    $posts = App\Post::find(1);
    //
    return $posts->tags;
    $vieos = App\Video::find(1);
    //    return $vieos->tags;
    $tags = App\Tag::find(2);
    //    return $tags->posts;
    foreach ($tags->posts as $post) {
        echo $post->pivot->tag_id;
    }
    //    return $tags->videos;
    return 'Hello World';
});
Route::get('/review', function () {
    $doctors = App\Doctor::find(1);
    return $doctors->reviews;
    $institutes = App\Institute::find(1);
    //    return $institutes->reviews;
    $user = App\User::find(1);
Example #2
0
Route::get('/play/{class}/{instructor}/{file}', 'PlayerController@playVideo');
//changed from remote edit
/*
Route::post('register', function(){
	alert("inside routes");
	if(Request::ajax()){
		return Response::json(Request::all());
	}
});
*/
/*Route::controllers([
	'auth' => 'Auth\AuthController',
	'password' => 'Auth\PasswordController',
]);*/
Route::bind('videos', function ($value, $route) {
    return App\Video::whereSlug($value)->first();
});
/*//Admin routes
Route::get('admin/index', function() {
  return View::make('admin');
});*/
//Route::controller('admin/index', 'AdminController');
/* Roles Routes
Route::get('/roles', 'RolesController@index');
Route::get('/roles/create', 'RolesController@create');
Route::get('/roles/{id}', 'RolesController@show');
Route::post('roles', 'RolesController@store');
*/
Route::resource('roles', 'RolesController');
Route::bind('roles', function ($value, $route) {
    return App\Role::findOrFail($value);
Example #3
0
  					<a title="Cliquez pour trier" href="?orderby=mark&order={{ $orderBy == 'mark' ? $order == 'asc' ? 'desc' : 'asc' : 'desc' }}">Likes/Dislikes
  					<span class="glyphicon glyphicon-triangle-bottom"></span><span class="glyphicon glyphicon-triangle-top"></span> </a>
  				</b></td>

  				<td width="115"><b>
  					<a title="Cliquez pour trier" href="?orderby=validation&order={{ $orderBy == 'validation' ? $order == 'asc' ? 'desc' : 'asc' : 'desc' }}">Validation
  					<span class="glyphicon glyphicon-triangle-bottom"></span><span class="glyphicon glyphicon-triangle-top"></span> </a>
  				</b></td>
  			</tr>
  		</thead>
  		<tbody>
	  		@if(count($videos) > 0)
		  		@for($i = 0; $i < count($videos); $i++)
		  			<?php 
$v = $videos[$i];
$infos = App\Video::where('id', $v['video_id'])->first();
?>
		  			<tr id="line{{$i}}">
		  				<td width="100"> {{ date_format($v['created_at'], 'd M Y H:i') }} </td>

		  				<td>{{ $v['user_id'] == 0 ? 'Anonyme' : App\User::where('id', $v['user_id'])->first()->name }}</td>

		  				<td>{{ $infos['artist'] }}</td>

		  				<td>
		  					<button id="play{{$i}}" onclick="return start(this)" data-link="{{ $infos['link'] }}" data-title="{{ $infos['title'] }}" data-artist="{{ $infos['artist'] }}" data-id="{{ $i }}" type="button" class="controls glyphicon glyphicon-play" title="Play"></button>
		  					<button onclick="return pause(this.getAttribute('data-id'))" title="Stop" data-id="{{ $i }}" type="button" class="controls glyphicon glyphicon-stop"></button>
		  				</td>

		  				<td>
		  					<a role="button" onclick="return start(this)" data-link="{{ $infos['link'] }}" data-title="{{ $infos['title'] }}" data-artist="{{ $infos['artist'] }}" data-id="{{ $i }}" class="videoLink'" id="lienVideo" title="Cliquez pour lancer la musique">{{ $infos['title'] }}</a>