Мое приложение показывает эту ошибку
Приложение Action \ Http \ Controllers \ ComplainController@comment не определено. (Просмотр: / var / www/html/Chirag_Laravel/resources/views/backend/pages/ifa/complaint.blade.php)
Но я уже ввел контроллер и маршрут работает правильно
Controller
часть:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\Complaint;
use App\Status;
use common;
class ComplainController extends Controller
{
//
public function index(Request $request)
{
$user_data=$request->session()->get('user_name');
$status=Status::SELECT('status')
->where('id','=',1)
->get();
$reports=Complaint::Where('raised_by','=',"$user_data")->SELECT('*')->get();
return view('backend.pages.ifa.complaint',compact('status','reports'));
}
public function store(Request $request)
{
// return $data = $request->all();
// echo carbon::now();
$user=$request->session()->get('user_name');
date_default_timezone_set('Asia/Kolkata');;
$date=date('Y:m:d');
$month=date('m-y');
$token= str_pad(mt_rand(1,99999999),8,'0',STR_PAD_LEFT);
$header=$request->input('issue_header');
$description=$request->input('issue_description');
$status=$request->input('status');
$input=$request->all();
$file= $request->file('document');
$name=$file->getClientOriginalName();
$file->move($month.' '.'Report-docs',$name);
$input['document']=$name;
$doc = $input['document'];
Complaint::create(["ticket_no"=>"$token","issue_header"=>"$header","issue_description"=>"$description","document"=>"$doc","status"=>"$status","raised_on"=>"$date",'raised_by'=>"$user"]);
// //Complaint::create($input);
$message="Report Submitted Successfully";
$request->session()->put(['work_success'=>$message]);
return redirect('ifa-dashboard/report-problems');
}
public function common(Request $request)
{
//echo 1;
$report_id=$request->get('report_id');
$change_status=$request->get('clientStat');
date_default_timezone_set('Asia/Kolkata');
$date=date('Y:m:d H:i:s');
for ($i=0; $i <1 ; $i++) {
# code...
Complaint::Where('id','=',"$report_id")
->Update(['status'=>"$change_status"]);
return redirect('ifa-dashboard/report-problems');
}
}
public function comment($id,Request $request)
{
$user_name=$request->session()->get('user_name');
$ticket=Complaint::Where('id','=',$id)
->SELECT('ticket_no')
->get();
foreach($ticket as $tickets)
{
$tik=$tickets['ticket_no'];
$comments=\DB::SELECT('SELECT comment,comment_by from comments where complaint_id=? AND comment_by=? or comment_by=? ORDER BY id DESC',[$tik,$user_name,'Admin']);
return view('backend.pages.ifa.comment',compact('tik','id','comments','user_name'));
}
}
public function getComment(Request $request)
{
$request->session()->put(['comment_success'=>'Comment Submitted Successfully']);
$report_id=$request->session()->get('report_id');
$complain=$request->get('tiko');
$user_name=$request->get('user_name');
$comment=$request->get('comment');
//echo $complain_id."<br>".$comment;
Comment::create(["complaint_id"=>"$complain","comment"=>"$comment","comment_by"=>"$user_name"]);
return redirect()->back();
}
}
Часть клинка:
<td><center><a href="{{action('ComplainController@comment', $report['id'])}}">Comment</a></center></td>
Не могу найти выход