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
var config = { | |
headers: { | |
"Content-Type": undefined // remove o content-type | |
}, | |
transformRequest: angular.identity // não transforma os parâmetros | |
}; | |
$http.post("/api/work-with-us", data, config).then(function(result){ | |
if(result){ | |
$log.info("Service_formularios: Trabalhe conosco enviado!"); | |
callback.resolve(true); |
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 Diario\Frontend\Http\Controllers; | |
use App\Http\Controllers\Auth\PasswordController as Base; | |
use Illuminate\Auth\Passwords\PasswordBroker; | |
use Illuminate\Http\Request; | |
use Illuminate\Mail\Message; | |
use Validator; | |
use Session; |
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\Middleware; | |
use Closure; | |
use Illuminate\Contracts\Auth\Guard; | |
use Auth; | |
class AdminAuthenticate extends Authenticate | |
{ |
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
//returns cropped image | |
function getPropertyImage($property) | |
{ | |
return Image::url(getImagePath($property), 315, 235, ['crop']); | |
} | |
//retorna o path da imagem, faz download da imagem | |
function getImagePath($property) | |
{ |
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
$collection = App\Post::all(); | |
$collection->macro('withBody', function(callable $callback){ | |
foreach ($this->items as $key => $item) { | |
if (!$item->body) { | |
continue; | |
} | |
if ($callback($item, $key) === false) { |
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
function getAdvertiserVehiclesViews($time = 30) | |
{ | |
return collect(LaravelAnalytics::performQuery( | |
Carbon::now()->subDays($time) | |
, Carbon::now() | |
, 'ga:totalEvents,ga:uniqueEvents' | |
, [ | |
'sort' => '-ga:totalEvents', | |
'dimensions' => 'ga:pagePath', | |
'filters' => 'ga:eventLabel==' . auth()->user()->advertiser_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
function daysSinceLastUpdate() | |
{ | |
$lastUpdate = null; | |
$carB = \Mixdinternet\Cars\Car::select(DB::raw('MAX(updated_at) AS updated_at'))->where('advertiser_id', auth()->user()->advertiser_id); | |
$vanB = \Mixdinternet\Vans\Van::select(DB::raw('MAX(updated_at) AS updated_at'))->where('advertiser_id', auth()->user()->advertiser_id); | |
$truckB = \Mixdinternet\Trucks\Truck::select(DB::raw('MAX(updated_at) AS updated_at'))->where('advertiser_id', auth()->user()->advertiser_id); | |
$trailerB = \Mixdinternet\Trailers\Trailer::select(DB::raw('MAX(updated_at) AS updated_at'))->where('advertiser_id', auth()->user()->advertiser_id); | |
$sailingB = \Mixdinternet\Sailings\Sailing::select(DB::raw('MAX(updated_at) AS updated_at'))->where('advertiser_id', auth()->user()->advertiser_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
private function getPaginator($products){ | |
$page = LengthAwarePaginator::resolveCurrentPage('page'); | |
$perPage = 5; | |
return new LengthAwarePaginator( | |
$products->slice(($page - 1) * $perPage)->take($perPage), | |
$products->count(), | |
$perPage, | |
$page, | |
[ | |
'path' => LengthAwarePaginator::resolveCurrentPath(), |
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\Middleware; | |
use Closure; | |
class Cors { | |
public function handle($request, Closure $next) | |
{ | |
return $next($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 | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use GuzzleHttp\Client; | |
class Iframe extends Command | |
{ | |
/** |
OlderNewer