-
app/Observers/VideoObserver.php
Open in GitHubuse App\Jobs\StartConvert; use App\Models\Channel\Video; use Illuminate\Support\Facades\Storage; class VideoObserver { // public function deleted(Video $video) { Storage::disk('public')->delete($video->path); Storage::disk($video->disk)->deleteDirectory('converted/' . $video->media_id); } }
-
app/Providers/AppServiceProvider.php
Open in GitHubuse App\Models\Channel\Video; use App\Observers\VideoObserver; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { // public function boot() { Video::observe(VideoObserver::class); } }