Try this
public function viewmodal($societyid)
{
return "Works";
}
If that not working, maybe your route is not working
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Write this in controller
$sd = DB::table('user')->where('societyid', '=', $societyid);
return view('admin.modalview', ['sd' => $sd])->render();
You view must contain only html with data from variable...
for test you can write alert in javaScript
<script>
$(document).ready(function(){
$("#societydetails").on("show.bs.modal", function(e) {
var id = $(e.relatedTarget).data('target-id');
$.get('/admin/society/' + id, function( data ) {
alert(data);
$(".modal-body").html(data);
});
});
});
</script>
Please or to participate in this conversation.