Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

range-of-motion/budget

1057 stars
2 code files
View range-of-motion/budget on GitHub

app/Events/ImportCreated.php

Open in GitHub
use App\Models\Import;
use App\Models\Activity;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Support\Facades\Auth;
 
class ImportCreated
{
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
 
public function __construct(Import $import)
{
Activity::create([
'space_id' => $import->space_id,
'user_id' => Auth::user()->id,
'entity_id' => $import->id,
'entity_type' => 'import',
'action' => 'import.created'
]);
}
}

app/Models/Import.php

Open in GitHub
use Illuminate\Database\Eloquent\Model;
 
class Import extends Model
{
//
protected $dispatchesEvents = [
'created' => ImportCreated::class,
//
];
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.