This code is working correctly but slow
class Content extends Eloquent {
protected $table = 'content';
public static function getTranslate($columns = array('*')) {
$lng_table = Config::get('language.table');
$lng_field = Config::get('language.field');
$instance = new static;
return $instance->newQuery()->join('lng_terms', function($join) {
$join->on('content.id', '=', 'lng_terms.gid')
->where('lng_terms.structure', '=', __CLASS__)
->where('lng_terms.lang', '=', LaravelLocalization::getDefaultLocale());
});
}
}
Route::group(array('prefix' => LaravelLocalization::setLocale()), function()
{
Route::get('/', function()
{
return View::make('hello');
});
Route::get('/{path}', function($url)
{
echo Content::getTranslate()->where('url', '=', $url)->get();
});
});
Can anyone help me to accelerate this code?
If i use 12.0.0.1 instead of localhost for mysql connection this working fast!))) Hurray!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community