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 | |
class Film { | |
protected $queryCriteria; | |
public function where($key, $value) | |
{ | |
$this->queryCriteria .= "Findind the Film by $key:$value\n"; | |
return $this; | |
} |
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 | |
/** | |
* Imagine if this came from the request or a database entry editable by the user. | |
* The Laravel URL validator relies on PHP's filter_var() method which considers | |
* file:// and php:// valid URLs. The vast majority of Laravel users probably | |
* expect this validator to only validate http:// & https:// | |
* @link http://www.php.net/manual/en/wrappers.php | |
*/ | |
Route::get('/', function () { | |
$url = 'file:///etc/hosts'; |
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 | |
return [ | |
// http://www.cidades.ibge.gov.br/download/mapa_e_municipios.php?uf=ac (Thu May 14 16:30:15 BRT 2015) | |
'AC' => [ | |
1200013 => 'Acrelândia', | |
1200054 => 'Assis Brasil', | |
1200104 => 'Brasiléia', | |
1200138 => 'Bujari', | |
1200179 => 'Capixaba', |
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 | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateCategoriesTable extends Migration { | |
/** | |
* Run the migrations. | |
* |
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
# Apache configuration file | |
# http://httpd.apache.org/docs/2.2/mod/quickreference.html | |
# Note: ".htaccess" files are an overhead for each request. This logic should | |
# be placed in your Apache config whenever possible. | |
# http://httpd.apache.org/docs/2.2/howto/htaccess.html | |
# Turning on the rewrite engine is necessary for the following rules and | |
# features. "+FollowSymLinks" must be enabled for this to work symbolically. |
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
// Adiciona o update na autenticacao! | |
public function __construct() { | |
$this->filter('before', 'auth')->only(array('create', 'your_questions', 'edit', 'update')); | |
} | |
public function put_update() { | |
$id = Input::get('question_id'); | |
if (!$this->question_belongs_to_user($id)) { | |
return Redirect::to_route('your_questions')->with('message', 'Invalid Question'); |
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
@layout("layouts.default") | |
@section('content') | |
<h1>Edit Your Question</h1> | |
@if($errors->has()) | |
<ul id="form-errors"> | |
{{ $errors->first('question', '<li>:message</li>') }} | |
{{ $errors->first('solved', '<li>:message</li>') }} | |
</ul> |
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
// Nossa ação de editar também deve ser protegida! | |
public function __construct() { | |
$this->filter('before', 'auth')->only(array('create', 'your_questions', 'edit')); | |
} | |
public function get_edit($id = NULL) { | |
if (!$this->question_belongs_to_user($id)) { | |
return Redirect::to_route('your_questions')->with('message', 'Invalid Question'); | |
} |
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
@layout('layouts.default') | |
@section('content') | |
<h1>{{ ucfirst($username) }} Questions</h1> | |
@if(!$questions->results) | |
<p>You've not posted any questions yet.</p> | |
@else | |
<ul> | |
@foreach($questions->results as $question) |
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
@layout('layouts.default') | |
@section('content') | |
<h1>{{ ucfirst($username) }} Questions</h1> | |
@if(!$questions->results) | |
<p>You've not posted any questions yet.</p> | |
@else | |
<ul> | |
@foreach($questions->results as $question) |
NewerOlder