Skip to content

Instantly share code, notes, and snippets.


Vitor Fernando Martins Faiante vitorf7

View GitHub Profile
vitorf7 / binder.php
Created Aug 14, 2019 — forked from arodbits/binder.php
Combine binding values into a raw SQL query in Laravel. Debugging in Laravel.
View binder.php
$query = Foo::where('id', '=', 1)->where('name', '=', 'bar');
//would produce the following raw query:
//select * from foo where id = ? and name = ?;
dd(vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function($binding){
return is_numeric($binding) ? $binding : "'{$binding}'";
vitorf7 /
Created Mar 7, 2018 — forked from ericmdev/
Docker - stop and remove all containers and images.
# Stop all containers.
docker stop $(docker ps -a -q)
# Delete all containers.
docker rm $(docker ps -a -q)
# Delete all images.
docker rmi --force $(docker images -q)
vitorf7 / Test.php
Last active Aug 29, 2015
Laravel 5 Testing with Authentication using L5 Helper Methods
View Test.php
// === Inside my ApiTester.php Class. Could be inside the same test class but I use this for methods to test my API === //
* Set Up Method for Tests
public function setUp()