Having been hit by "this works fine on dev but not after deploy" a few times myself. My suggestion if you haven't already is to do a "php artisan route:clear".
I think i've found the possible bug:
public function update(Request $request, $id) {
//
$post = News::findOrFail($id);
$update = $request->only('date', 'title', 'cont');
$update['updated_at'] = Carbon::now();
$post->update($update);
return redirect('admin/news');
}
That's my form from the edit view:
{!! Form::model($post, ['method' => 'PATCH', 'files' => true, 'url' => 'admin/news/'.$post->id]) !!}
{!! Form::text('date', null, ['id' => 'dp', 'class' => 'admin-create-news-field form-control', 'placeholder' => 'Data', 'data-date-format' => 'dd-mm-yyyy hh:ii']) !!}
{!! Form::text('title', null, ['id' => 'news-title', 'class' => 'admin-create-news-field form-control', 'placeholder' => 'Titolo']) !!}
{!! Form::textarea('cont', null, ['id' => 'news-text', 'class' => 'admin-create-news-field form-control', 'placeholder' => 'Testo']) !!}
{!! Form::submit('Salva', ['id' => 'post-submit', 'class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
In my NewsController, where i store and update my posts from my admin panel, i see that after i apply an update, if i check my database i see that the column "created_at" changes too. I'm searching why this happen.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community