Handy Snippets

Temporarily disable timestamps in Laravel

Here’s how you can temporarily disable timestamps (created_at and updated_at fieldss) in Laravel.

$post = Post::find(1);
$post->timestamps = false;
$post->title = 'New Title';
$post->save();

Enable design mode on the document

Just run the following command in the console and you’ll be able to edit the webpage you’re on.

document.designMode = 'on'