Undefined variable: categories in Blade Laravel 6.4.0

I am trying to show my categories on the site map page with the controller below. CategoryController.php class CategoriesController extends Controller { public function create() { $categories = Category ::orderBy(‘name’,’desc’) ->where(‘parent_id’, NULL) ->get(); return view(‘admin.category.create’, compact(‘categories’)); } } The following is the part of my Blade file where I use the categories variable template. create.blade.php…

Laravel connection error in macOS Mojave?

SQLSTATE[HY000] [2002] No such file or directory (SQL: select * where uid=501(isa) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh) = 1 limit 1)

Convert MYSQL query to Laravel way

I have to convert these queries to Laravel way. $tqry = “select app_process,end_time,((end_time-“.time().”)/86400)as remain_day from BYAPPS_apps_data where mem_id=’$valu[mem_id]’ limit 1″; $tresult = $_DB->query($tqry); $tmp=$tresult->fetchRow(); if($tmp[app_process]){ $status=$app_process[$tmp[app_process]]; if($tmp[app_process]==7&&($tmp[end_time]&&$tmp[remain_day]<=0)) $type=”Expired”; }else { $tqry = “select app_process from BYAPPS_apps_order_data where mem_id=’$valu[mem_id]’ order by idx desc limit 1″; $tresult = $_DB->query($tqry); $tmp=$tresult->fetchRow(); if($tmp[app_process]) $status=$ord_process[$tmp[app_process]]; else $status=”Not Customer”; } I…

how to solve laravel file uploading problem

I tried to upload image on my public folder but i constantl getting error like this The “C:\xampp\tmp\phpCE7B.tmp” file does not exist or is not readable. Her is my code that i tried so far public function create(Register $request) { //Registering Students $student=new Student; $student->name = $request->input(‘name’); $student->username = $request->input(‘username’); $student->email = $request->input(’email’); $student->password =…

Laravel Why pivot table is empty?

I have a simple relationship in laravel eroquent Here is the bidders table creation public function up() { Schema::create(‘bidders’, function (Blueprint $table) { $table->bigIncrements(‘id’); $table->string(‘params_name’); $table->string(‘params_value’); $table->string(‘bidder_name’); $table->timestamps(); }); } Here is bidder_parameter table creation public function up() { Schema::create(‘bidder_parameters’, function (Blueprint $table) { $table->bigIncrements(‘id’); $table->unsignedBigInteger(‘bidder_id’); $table->foreign(‘bidder_id’)->references(‘id’)->on(‘bidders’)->onDelete(‘cascade’); $table->timestamps(); }); } Here is a bidder model…

My Laravel Vue App Does Not Delete a Record. Do I need to Bind my Button so that it will redirect to the controller?

Hi I am currently making an app with a simple CRUD operation and I am bothered why my code isn’t deleting a record whenever I press the delete button. I am a newbie in Laravel and Vue and currently familiarizing the functions and workflows of the 2 frameworks. I have a table called posts and…