如何在Laravel中撤消我的重定向操作?

时间:2018-08-06 10:12:28

标签: laravel redirect url-routing

我已将public int onStartCommand(Intent intent, int flags, int startId)的路径重定向到/admin/kurslar/create

然后,我删除了重定向代码部分。但是重定向功能不会被取消。我的问题是如何撤消重定向方法?

我的网络路线:

/admin/kurslar/qoshish

我的控制器:

Route::group(['middleware' => ['web']], function () {
    Route::get('/kurs', 'PagesController@getKurs');
    Route::get('/tadbirlar', 'PagesController@getTadbirlar');
    Route::get('/blog', 'PagesController@getBlog');
    Route::get('/kurslar', 'PagesController@getKurslar');
    Route::get('/biz-haqimizda', 'PagesController@getBiz_haqimizda');
    Route::get('/aloqa', 'PagesController@getAloqa');
    Route::get('/', 'PagesController@getWelcome');

    Route::resource('/admin/kurslar', 'KurslarController');
    Route::get('/admin/kurslar/create', function () {
        return redirect('/admin/kurslar/qoshish');
    });

    Route::resource('/admin/kategoriyalar/kategoriya-qoshish', 'KategoriyalarController');
    Route::resource('/admin/teglar/teg-qoshish', 'TeglarController');
});

我用过<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use App\Http\Controllers\Controller; use App\Kurslar; use Session; class KurslarController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('admin/kurslar/index'); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $kategoriyalar = DB::table('kategoriyalars')->pluck('kategoriya'); foreach ($kategoriyalar as $kategoriya) { $kategoriyaAss[$kategoriya] = $kategoriya; } $teglar = DB::table('teglars')->pluck('teg'); foreach ($teglar as $teg) { $tegAss[$teg] = $teg; } return view('admin/kurslar/qoshish')->withKategoriyaAss($kategoriyaAss)->withTegAss($tegAss); } } ,但没有用。

0 个答案:

没有答案