Support the ongoing development of Laravel.io →
Configuration Eloquent Views
Last updated 1 year ago.
0

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".

0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

b82 b82 Joined 12 May 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.