enter image description here These are my files which is not showing my data in html only data is processing and no error also. I want to look my database through laravel in a html file but it's only processing and also not showing any error. so please help me on this error.
-
no error, the ajax response is good, but data not shown and processing box keeps showing.
-
Yajra 9.0
- Laravel 5.8
MemberController.php
<?php
namespace App\Http\Controllers;
use App\Models\Member;
use Illuminate\Http\Request;
use Datatables;
use Validator;
class MemberController extends Controller
{
public function addSocialMember(){
return view("home.views.social-member");
}
public function listMember(){
return view("home.views.memberlist");
}
public function listAllMember(){
$memberlist = Member::query();
return Datatables::of($memberlist)->make(true);
}
public function saveMember(Request $request){
$validator = Validator::make(array(
"name"=>$request->name,
"email"=>$request->email,
"phone"=>$request->phone,
"state"=>$request->state,
"city"=>$request->city,
"issue"=>$request->issue,
"message"=>$request->message,
),array(
"name"=>"required",
"email"=>"required|unique:member",
"phone"=>"required",
"state"=>"required",
"city"=>"required",
"issue"=>"required",
"message"=>"required",
));
if($validator->fails()){
return redirect("social-member")->withErrors($validator)->withInput();
}else{
//successfully we have passed our form
$member = new Member;
$member->name = $request->name;
$member->email = $request->email;
$member->phone = $request->phone;
$member->state = $request->state;
$member->city = $request->city;
$member->issue = $request->issue;
$member->message = $request->message;
$member->save();
$request->session()->flash("message","Member has been submitted form successfully");
return redirect("social-member");
}
}
}
Memberlist.blade.php
@extends("home.layouts.layout")
@section("title","Social Member | Bheekho Foundation")
@section("content")
<div class="container padding-top-three">
<br/>
<blockquote><h4>We need Help</h4></blockquote>
<br/>
<div class="row">
<div class="col-md-12">
<table class="table table-striped table-bordered" id="memberlist">
<thead>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>State</th>
<th>City</th>
<th>Issue</th>
<th>Describe Your Issues</th>
<th>Status</th>
</thead>
</table>
</div>
</div>
@endsection
web.php
<?php
Route::get("/","HomeController@homepage");
//Social Member Route
Route::get("/social-member","MemberController@addSocialMember")->name("addsocialmember");
Route::get("/memberlist","MemberController@listMember")->name("listmember");
Route::get("/memberlist-data","MemberController@listAllMember")->name("listallmember");
Route::post("/save-member","MemberController@saveMember")->name("savemember");
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire