initial commit
This commit is contained in:
24
app/Http/Controllers/Admin/PatientController.php
Normal file
24
app/Http/Controllers/Admin/PatientController.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Patient;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
|
||||
class PatientController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$patients = Patient::all();
|
||||
return view('admin.patients.index', ['patients' => $patients]);
|
||||
}
|
||||
|
||||
public function delete($id,Request $request)
|
||||
{
|
||||
Patient::where('id',$id)->delete();
|
||||
$request->session()->flash('message', 'Patient deleted successfully');
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user