/** * Display a listing of the resource. * * @return Response */ public function index() { // $singlemusics = SingleMusic::orderBy('id', 'desc')->paginate(10); $mtvs = Mtv::orderBy('id', 'desc')->paginate(10); $mp3downloads = SingleMusic::where('count', '>=', '0')->sum('count'); return view('mobile.single.index')->with('singlemusics', $singlemusics)->with('mtvs', $mtvs)->with('mp3downloads', $mp3downloads); }
public function destroy($id) { // $mtv = Mtv::find($id); $mtv->delete(); \Flash::info('Completed'); return \Redirect::to('/backend/admin/mobile/songs'); }
Route::get('/api/language/{language}', 'LanguageController@show'); Route::get('/api/songs/request/', 'RequestController@apishow'); Route::post('/api/songs/request/', 'RequestController@apirequest'); Route::get('/api/songs/send/', 'SendController@apishow'); Route::post('/api/songs/send/', 'SendController@apisend'); Route::get('/api/update/version', function () { return "1.3"; }); }); Route::group(['middleware' => 'auth'], function () { Route::get('/backend/admin/mobile/songs/all', function () { $singlemusic = \App\SingleMusic::orderBy('id', 'desc')->get(); return \Response::json($singlemusic); }); Route::get('/backend/admin/mobile/mtv/all', function () { $mtv = \App\Mtv::orderBy('id', 'desc')->get(); return \Response::json($mtv); }); Route::get('/logout', 'LoginController@dologout'); Route::resource('/music', 'SingleController'); Route::resource('/album', 'AlbumController'); Route::resource('/backend/admin/mobile/songs/', 'MobileSingleController'); Route::get('/backend/admin/mobile/songs/{id}', 'MobileSingleController@show'); Route::post('/backend/admin/mobile/songs/{id}', 'MobileSingleController@update'); Route::get('/backend/admin/mobile/songs/{id}/edit', 'MobileSingleController@edit'); Route::delete('/backend/admin/mobile/songs/delete/{id}', 'MobileSingleController@destroy'); Route::resource('/backend/admin/mobile/mtv/', 'MtvController'); Route::get('/backend/admin/mobile/mtv/{id}', 'MtvController@show'); Route::post('/backend/admin/mobile/mtv/{id}', 'MtvController@update'); Route::delete('/backend/admin/mobile/mtv/delete/{id}', 'MtvController@destroy'); Route::get('/backend/admin/mobile/mtv/{id}/edit', 'MtvController@edit');