Skip to content

Instantly share code, notes, and snippets.

@jalallinux
Last active October 8, 2022 12:48
Show Gist options
  • Save jalallinux/58d7b23acde1417ec8960d9566c53135 to your computer and use it in GitHub Desktop.
Save jalallinux/58d7b23acde1417ec8960d9566c53135 to your computer and use it in GitHub Desktop.
Laravel - Observer Stub
<?php
namespace {{ namespace }};
use {{ namespacedModel }};
class {{ class }}
{
/**
* Handle the {{ model }} "creating" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function creating({{ model }} ${{ modelVariable }})
{
//
}
/**
* Handle the {{ model }} "created" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function created({{ model }} ${{ modelVariable }})
{
//
}
/**
* Handle the {{ model }} "updating" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function updating({{ model }} ${{ modelVariable }})
{
//
}
/**
* Handle the {{ model }} "updated" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function updated({{ model }} ${{ modelVariable }})
{
//
}
/**
* Handle the {{ model }} "deleting" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function deleting({{ model }} ${{ modelVariable }})
{
//
}
/**
* Handle the {{ model }} "deleted" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function deleted({{ model }} ${{ modelVariable }})
{
//
}
/**
* Handle the {{ model }} "restored" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function restored({{ model }} ${{ modelVariable }})
{
//
}
/**
* Handle the {{ model }} "force deleted" event.
*
* @param {{ model }} ${{ modelVariable }}
* @return void
*/
public function forceDeleted({{ model }} ${{ modelVariable }})
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment