Created
October 2, 2019 16:26
-
-
Save rodrigoSyscop/c588f0ddc0d950282929ab5d90b9c444 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Http\Requests\UrlRequest; | |
use App\Model\Url; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Validator; | |
class UrlController extends Controller | |
{ | |
public function index(Request $request) { | |
$urls = Url::all(); | |
return view('system.index', compact('urls')); | |
} | |
public function getUrl(UrlRequest $request) { | |
$result = Url::store($request); | |
if (! $result ) { | |
return redirect()->back()->withErrors(['error', 'Url inválida']); | |
} | |
return redirect()->route('index')->with('success','Url inserida com sucesso'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
O código dele está assim: