function buildTh($title = '') { $html = ''; foreach (LaravelLocalization::getSupportedLocales() as $localeCode => $properties) { $html .= '<th>' . $properties['native'] . ' ' . $title . '</th>'; } return $html; }
/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker::create(); // retrieve all the user_ids from DB $users = DB::table('users')->pluck('id'); // create posts for a single user only // $users = ['0'=>'34']; //echo '<pre>'; print_r($users); echo '</pre>'; exit; // retrieve all the taxon_ids from DB $taxons = DB::table('blog_taxons')->pluck('id'); // the following commneted lines add the same user for each post //factory(App\Models\Posts\Post::class, 5)->create([ // 'user_id' => $faker->randomElement($users) //]); // the following lines add a diferent user for each post foreach (range(1, 5) as $index) { //the following lines make use of the model factory //$post = factory(App\Models\Posts\Post::class)->create([ // 'user_id' => $faker->randomElement($users) //]); $post = App\Models\Posts\Post::create(['title' => ucwords(implode(' ', $faker->words(5))), 'is_public' => $faker->boolean, 'identifier' => $faker->slug, 'post_type' => $faker->word, 'content' => implode(' ', $faker->paragraphs(3)), 'content_data' => implode(' ', $faker->paragraphs(3)), 'draft' => implode(' ', $faker->paragraphs(3)), 'producer_name' => $faker->word, 'youtube_code' => $faker->word, 'copyright_holder' => $faker->word, 'reference_link_target' => $faker->word, 'source_of_supply' => $faker->word, 'user_id' => $faker->randomElement($users)]); foreach (LaravelLocalization::getSupportedLocales() as $locale => $data) { if ($locale != LaravelLocalization::getCurrentLocale()) { $post->translateOrNew($locale); $post->translate($locale)->title = strtoupper($locale) . '::' . ucwords(implode(' ', $faker->words(5))); //$post->translate($locale)->slug = $faker->slug; $post->translate($locale)->identifier = $faker->slug; $post->translate($locale)->content = implode(' ', $faker->paragraphs(3)); $post->translate($locale)->content_data = implode(' ', $faker->paragraphs(3)); $post->translate($locale)->draft = implode(' ', $faker->paragraphs(3)); } } $post->save(); if (count($taxons)) { $post->taxons()->attach($faker->randomElement($taxons)); } } }
<link href="{{{ Module::asset('formbuilder:css/styles.css') }}}" rel="stylesheet" type="text/css" /> @stop @section('content') {!! Form::open(['route' => ['admin.formbuilder.formbuilder.update', $form->id], 'method' => 'put', 'files' => true]) !!} {!! Form::hidden("id", $form->id) !!} <div class="row"> <div class="col-xs-12"> <div class="nav-tabs-custom"> @include('partials.form-tab-headers', ['fields' => ['title', 'body']]) <div class="tab-content"> <?php $i = 0; ?> <?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language) { ?> <?php ++$i; ?> <div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}"> <div class="nav-tabs-custom"> <ul class="nav nav-tabs"> <li class="active"> <a data-toggle="tab" href="#tab_form_{{ $i }}" aria-expanded="false" onclick="">{!! trans('formbuilder::formbuilder.tab.form') !!}</a> </li> <li class=""> <a data-toggle="tab" href="#tab_mail_{{ $i }}" aria-expanded="false" onclick="">{!! trans('formbuilder::formbuilder.tab.mail') !!}</a> </li> <li class="">
<?php /* |-------------------------------------------------------------------------- | Frontend Routes |-------------------------------------------------------------------------- */ $languages = LaravelLocalization::getSupportedLocales(); foreach ($languages as $language => $values) { $supportedLocales[] = $language; } $locale = Request::segment(1); if (in_array($locale, $supportedLocales)) { LaravelLocalization::setLocale($locale); App::setLocale($locale); } Route::get('/', function () { return Redirect::to(LaravelLocalization::getCurrentLocale(), 302); }); Route::group(array('prefix' => LaravelLocalization::getCurrentLocale(), 'before' => array('localization', 'before')), function () { Session::put('my.locale', LaravelLocalization::getCurrentLocale()); // frontend dashboard Route::get('/', ['as' => 'dashboard', 'uses' => 'HomeController@index']); // article Route::get('/article', array('as' => 'dashboard.article', 'uses' => 'ArticleController@index')); Route::get('/article/{slug}', array('as' => 'dashboard.article.show', 'uses' => 'ArticleController@show')); // news Route::get('/news', array('as' => 'dashboard.news', 'uses' => 'NewsController@index')); Route::get('/news/{slug}', array('as' => 'dashboard.news.show', 'uses' => 'NewsController@show')); // tags Route::get('/tag/{slug}', array('as' => 'dashboard.tag', 'uses' => 'TagController@index'));
<span class="icon-bar"></span> </button> <a class="navbar-brand" href="<?php echo e(url($_lang . DIRECTORY_SEPARATOR . "/")); ?> ">Youitems.com <?php echo e(_('Translated')); ?> </a> </div> <div id="navbar" class="navbar-collapse collapse" aria-expanded="false" style="height: 1px;"> <ul class="nav navbar-nav"> <?php foreach (LaravelLocalization::getSupportedLocales() as $localeCode => $properties) { ?> <li class="<?php if (Request::segment(1) == $localeCode) { ?> overwrite <?php } ?> "> <a rel="alternate" hreflang="<?php echo e($localeCode); ?> " href="<?php echo e(LaravelLocalization::getLocalizedURL($localeCode)); ?>