initial commit
This commit is contained in:
46
app/Http/Controllers/SongController.php
Normal file
46
app/Http/Controllers/SongController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Song;
|
||||
use App\Policies\SongPolicy;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class SongController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
// render page
|
||||
Inertia::render('Songs/Index', [
|
||||
'songs' => Song::all()
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// Store a new song
|
||||
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// Update specified song
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
// Delete specified song
|
||||
$this->authorize('delete', Song::class);
|
||||
|
||||
$song = Song::find($id);
|
||||
if ($song) {
|
||||
$song->delete();
|
||||
}
|
||||
}
|
||||
|
||||
public function stream($id)
|
||||
{
|
||||
// Stream specified song
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user