Wenn ich ein Produkt aktualisiere, werden die Daten nicht aktualisiert.Laravel 5 speichern und aktualisieren funktioniert nicht.
Folgen Code
mein Controller
public function viewProduct($name, $id)
{
$product = $this->queryProducts()
->where('produtos.id' , $id)
->first();
$product->count_view += 1;
$product->save();
}
My Model
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Products extends Model
{
protected $guarded = ['id'];
protected $table = 'produtos';
const CREATED_AT = 'created';
const UPDATED_AT = 'modified';
protected $fillable = ['count_view', 'nome'];
Wenn ich
dd($product->save())
meine Rückkehr ist wahr, und ich versuchte, die Methode save() von anderem Weg
$product->save(['count_view' => 77 ])
und/oder
$product->update(['count_view' => 77 ])
Aber keine Art und Weise funktioniert