public function getLocales() { // $locales = Config::get('app.locales'); // if ( Schema::hasTable('locales') ) { $locales = Locale::all(); if (empty($locales)) { throw new LocalesNotDefinedException('Please make sure you have run "php artisan config:publish dimsav/laravel-translatable" ' . ' and that the locales configuration is defined.'); } //} //dd($locales); return $locales; }
/** * Datatables data * * @return Datatables JSON */ public function data() { // $query = Locale::select(array('general::locales.id','general::locales.name','general::locales.description')) // ->orderBy('general::locales.name', 'ASC'); // $query = Locale::select('id', 'name' 'description', 'updated_at'); // ->orderBy('name', 'ASC'); $query = Locale::select('id', 'name', 'description', 'updated_at'); //dd($query); return Datatables::of($query)->addColumn('actions', ' <a href="{{ URL::to(\'admin/locales/\' . $id . \'/edit\' ) }}" class="btn btn-success btn-sm" > <span class="glyphicon glyphicon-pencil"></span> {{ trans("kotoba::button.edit") }} </a> ')->make(true); }
public function getLocales() { // $config = App::make('config'); // $locales = (array) $config->get('languages.supportedLocales', []); $locales = Locale::all(); // $locales = DB::table('locales') // ->lists('locale'); //dd($locales); if (empty($locales)) { throw new LocalesNotDefinedException('Please make sure you have run "php artisan config:publish dimsav/laravel-translatable" ' . ' and that the locales configuration is defined.'); } return $locales; }
/** * Update a role. * * @param array $inputs * @param int $id * @return void */ public function update($input, $id) { //dd($input['enabled']); $locale = Locale::find($id); $locale->update($input); }