<div class="panel panel-primary">
  <div class="panel-heading">
    <h2><?php echo app('translator')->getFromJson('backend.page-name'); ?></h2>
  </div>
  <?php echo Form::open(['url' => route('savePageName'),'method' => 'post']); ?>

    <div class="panel-body">
      <?php if(Session::has('message-pagename')): ?>
        <div id="message-pagename" class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <p><?php echo e(Session::get('message-pagename')); ?></p>
        </div>
      <?php endif; ?>

      <?php $__currentLoopData = $pageName; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="panel panel-primary">
          <div class="panel-heading">
            <h3><?php echo e(ucwords(str_replace('-',' ',$value->key))); ?></h3>
          </div>
          <div class="panel-body">
            <?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <?php 
                $locale = App\Pagename::find($value->id)->locales()->where('locale',$lang)->first();
                if(count(config('translatable.locales')) > 1){
                  $name = "Name [".$language."]";
                }else{
                  $name = "Name";
                }

                if(empty($locale)){
                  $pagename = "";
                }else{
                  $pagename = $locale->page_name;
                }
               ?>
              <div class="form-group col-xs-12 col-sm-6">
                <?php echo Form::label('pagename',$name,['class'=>'control-label']); ?>

                <?php echo Form::text('pagename['.$value->id.']['.$lang.']',$pagename,['class'=>'form-control']); ?>

              </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
          </div>
        </div>
      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
    <div class="modal-footer">
      <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.update'); ?></button>
    </div>
  <?php echo Form::close(); ?>

</div>
