This file contains 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\Helpers; | |
class Tree | |
{ | |
public $total; | |
public $hasUp; | |
public $hasDown; | |
public $id; |
This file contains 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
Array | |
( | |
[left] => | |
[center] => Array | |
( | |
[user_id] => 5 | |
[name] => Leo Turner | |
[username] => ayla.zemlak | |
[email] => [email protected] | |
[sponsor] => 1 |
This file contains 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
// controller | |
if( $validator->fails() ) { | |
return response()->json( $validator->errors()->fails(), 200 ); | |
} else { | |
return response()->json( [ | |
'success' => 'true', | |
'message' => 'Contato enviado com sucesso!' | |
], 200); | |
} |
This file contains 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
<div class="col-xs-12"> | |
<div id="alertas"></div> | |
{{ Form::open([ | |
'url' => url('url/para/a/rota'), | |
'id' => 'MyForm', | |
'method' => 'POST' | |
]); | |
{{ Form::text('nome', '', ['class'=>'form-group', 'id'=>'nome']) }} | |
This file contains 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 Illuminate\Http\Request; | |
use Request as RequestAjax; | |
class FormController extends Controller | |
{ | |
public function index( Request $request ) |
This file contains 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 | |
Route::post('url/para/a/rota', 'FormController@index'); |
This file contains 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
'use strict'; | |
(function( $ ) { | |
$('#MyForm').submit(function() { | |
$.ajax({ | |
url: 'http://localhost:8000/url/para/a/rota', | |
method: 'POST', | |
success: function( response, textStatus, jqXHR ) { | |
// message vem da key 'message' no response de sucesso do controller. | |
$('#alertas').text(response.message); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>GO2FUN </title> | |
<link href="/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" /> | |
<link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.css"/> | |
<link rel="stylesheet" href="/dist/css/formValidation.css"/> | |
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css"> | |
</head> | |
<body> |
This file contains 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\Helpers\Billet; | |
use App\Helpers\Register; | |
use App\Helpers\UUID; | |
use Input; | |
use Admin; | |
use Config; |
This file contains 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 DB; | |
use Illuminate\Http\Request; | |
use App\Evento; | |
use Auth; | |
use App\User; | |
use App\Usuario; | |
use App\Preferencia; |