Skip to content

Instantly share code, notes, and snippets.

@vineeth030
Created July 10, 2020 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vineeth030/6202d4b17178564ee5d7cde021e0f7ac to your computer and use it in GitHub Desktop.
Save vineeth030/6202d4b17178564ee5d7cde021e0f7ac to your computer and use it in GitHub Desktop.
<?php
/**
* Handle the post "creating" event.
*
* @param \App\Post $post
* @return void
*/
public function creating(Post $post)
{
$post->author_id = Auth::user()->id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment