Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Laravel Model Save Method

Criando post e salvando no banco

  $post = new Post([
    'title' => 'Batatas não avoam',
    'author' => 'Lucas Pires',

Atualizando titulo do Post

  $post = Post::find($id);
  $post->title = 'Novo titulo';

Atualizando várias informações ao mesmo tempo

  $post = Post::find($id);


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.