Skip to content

Instantly share code, notes, and snippets.

<?php
public function extract($entities ,array $columns = null)
{
if (!is_array($entities)) $entities = [ $entities ];
$fieldMappings = \EntityManager::getClassMetadata('Modules\Api\Entity\Product')->fieldMappings;
$associationMappings = \EntityManager::getClassMetadata('Modules\Api\Entity\Product')->associationMappings;
//redirect to vHost
Route::group(['prefix' => 'vestibular'], function()
{
Route::any('/', function()
{
return Redirect::to('http://vestibular.laravel-lab');
});
Route::any('{all}', function($uri = "")
@melloc01
melloc01 / Routing VirtualHosts on Laravel 4
Last active August 29, 2015 14:06
Routing VirtualHosts on Laravel 4
/*
|--------------------------------------------------------------------------
| Routing for VirtualHosts
|--------------------------------------------------------------------------
|
| If the App receives the request
| module.laravel.com
| It is translated to
| laravel.com/module
|
@melloc01
melloc01 / check_mobile.php
Created August 28, 2014 15:22
PHP - Check mobile devices by HTTP_USER_AGENT
$android = strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"android");
$ipad = strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"ipad");
$iphone = strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"iphone");
$ipod = strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"ipod");
if ( ($android === false) && ($ipad === false) && ($iphone === false) && ($ipod === false) )
$mobile = "false";
else
$mobile = "true";