<?php $__env->startSection('content'); ?>

<div class="col-md-9">

	<div class="">
		<h2>Редактирование материала</h2>
    </div>
	
	<?php if(count($errors) > 0): ?>
	    <div class="alert alert-danger">
	        <ul>
	            <?php foreach($errors->all() as $error): ?>
	                <li><?php echo e($error); ?></li>
	            <?php endforeach; ?>
	        </ul>
	    </div>
	<?php endif; ?>

	<?php if(session('message')): ?>
	    <div class="alert alert-success">
	        <?php echo e(session('message')); ?>

	    </div>
	<?php endif; ?>
	
	<?php if (Gate::denies('update',$article)): ?>
		<div class="alert alert-danger">
	        Нет прав
	    </div>
	    
	<?php endif; ?>
	
	<form method="post" action="<?php echo e(route('admin_update_post_p')); ?>">
	<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
	<input type="hidden" name="id" value="<?php echo e($article->id); ?>">
	  <div class="form-group">
	    <label for="name">Заголовок</label>
	    <input type="text" class="form-control" id="name" name="name" value="<?php echo e($article->name); ?>" placeholder="Заголовок">
	  </div>
	  <div class="form-group">
	    <label for="img">Изображение</label>
	    <input type="text" class="form-control" id="img" value="<?php echo e($article->img); ?>" name="img" placeholder="img">
	  </div>
	  <div class="form-group">
	    <label for="text">Text</label>
	    <textarea class="form-control" id="text" name="text" rows="3"><?php echo e($article->text); ?></textarea>
	  </div>
	  <button type="submit" class="btn btn-primary">Submit</button>
	</form>
</div>	
<?php $__env->stopSection(); ?>
<?php echo $__env->make('default.layouts.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>