{"message":"The given data was invalid.","errors":{"email":["The email has already been taken."]}}
Laravel will not generate a redirect response. Instead, Laravel generates a JSON response containing all of the validation errors. This JSON response will be sent with a 422 HTTP status code.
<?php
$posts = [
['title' => 'title1', 'content' => 'content1'],
['title' => 'title2', 'content' => 'content2'],
['title' => 'title3', 'content' => 'content3'],
];
foreach ($posts as $post) : ?>
<h2><?php echo $post['title']?></h2>
<p><?php echo $post['content']?></p>
<?php endforeach;
<?php
namespace RestartPackage\Models;
use Illuminate\Database\Eloquent\Model;
use RestartPackage\Traits\CamelCaseTrait;
abstract class AbstractModel extends Model
{
use CamelCaseTrait;
/**
* Indicates whether attributes are snake cased on arrays.
*
* @var bool
*/
public static $snakeAttributes = false;
}
Кнопка на обновление данных о статье в БД. Ловиться по имени. Стоит условие
if (isset($_POST['up']) {
...
}
Попробуйте