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 ItemsController extends BaseController { | |
/** | |
* Display a listing of the resource. | |
* | |
* @return Response | |
*/ | |
public function index() { |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| 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 Closure to execute when that URI is requested. |
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 | |
require_once 'cdp.class.php'; | |
$cdp = new CalculoDePrescricao; | |
$cdp->data_do_crime = $_POST['data_do_crime']; | |
$cdp->data_da_denuncia = $_POST['data_da_denuncia']; | |
$cdp->idade_criminoso = $_POST['idade_criminoso']; | |
$cdp->pena_maxima = $_POST['pena_maxima']; |
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 | |
define('TRAKT_APIKEY', $argv[1]); | |
define('TRAKT_USERNAME', $argv[2]); | |
define('TRAKT_PASSWORD', $argv[3]); | |
define('IMDB_EMAIL', $argv[4]); | |
define('IMDB_PASSWORD', $argv[5]); | |
define('IMDB_UID', $argv[6]); | |
function curl_post($urlpre, $data, $urlpost = '') |
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 | |
// APENAS A PARTE RELEVANTE | |
public function fotos() | |
{ | |
return $this->hasMany('\App\UserFoto'); | |
} | |
?> |
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\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
class CreateUsersFotosTable 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
<?php | |
// This will create a product, apply a discount since it is a new | |
// product, and send a notification via email | |
public function store() | |
{ | |
// Create product from request | |
$product = Product::create($request->all()); | |
// Get the discount to be applied | |
$discount = Discount::byType('newProduct'); |
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 | |
protected function createProduct() | |
{ | |
} | |
protected function applyDiscount($type, $product) | |
{ | |
} |
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 | |
protected function createProduct() | |
{ | |
return Product::create($this->request->all()); | |
} | |
protected function applyDiscount($type, $product) | |
{ | |
$discount = Discount::byType($type); |
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 | |
public function store() | |
{ | |
$product = $this->createProduct(); | |
$this->applyDiscount('newProduct', $product); | |
$this->notifyUsersVia('email'); | |
return 'Success'; | |
} |
OlderNewer