<?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. | */ use App\Model\Crawl; use App\Model\DmmList; Route::get('/', function () { $crawls = Crawl::orderBy('status', 'desc')->orderBy('id', 'desc')->get(); return view('welcome', ['crawls' => $crawls]); }); Route::get('/go/{id}', function ($id) { $crawl = Crawl::find($id); if ($crawl) { $crawl->status = Crawl::DISABLE; $crawl->save(); return redirect("http://extratorrent.cc{$crawl->href}"); } return response('id not found'); }); Route::get('/dmm', function () { $dmms = DmmList::orderBy('id', 'desc')->get(); return view('dmm', ['dmms' => $dmms]); });