I am trying to eager load parameter in eloquent laravel 5.8

I am trying to eager load data from a many-to-many relationship in eloquent laravel 5.8. The below code was working in laravel 5.5 but now it is not working in my new version i.e. 5.8 $data = Recruitment::find($id); $candidates = $data->candidates() ->with([ ‘status’=> function ($query) use ($id) { return $query->where(‘recruitment_id’, $id); }, ‘interviews’=> function ($query)…

How to upload an image to a specific folder on cloudiary with laravel jrm2k6/cloudder

I want to crop the avatar image and upload that on a specific folder of cloudiary using Laravel jrm2k6/cloudder but faced to a error to upload an image. Can anyone help me what’s wrong or show how to solve? Following is the error message stored on a log file. [2019-10-20 10:39:38] local.ERROR: Invalid Signature 22800853dcbe6c9972b65d99946460f1965a6e06.…

Laravel – How to Import Vue Component to Another Component

I am new in Vue.js. I want to understand on using component. I tried to import my component to another component but it failed. I am using Laravel 5.8. Below are the error that I received. Module not found: Error: Can’t resolve ‘./components/modalAlert.vue Below are my codes. app.js Vue.component(‘form-to-do’, require(‘./components/formToDo.vue’).default); Vue.component(‘modal-alert’, require(‘./components/modalAlert.vue’).default); const app =…

Laravel – How to Import Vue Component to Another Component

I am new in Vue.js. I want to understand on using component. I tried to import my component to another component but it failed. I am using Laravel 5.8. Below are the error that I received. Module not found: Error: Can’t resolve ‘./components/modalAlert.vue Below are my codes. app.js Vue.component(‘form-to-do’, require(‘./components/formToDo.vue’).default); Vue.component(‘modal-alert’, require(‘./components/modalAlert.vue’).default); const app =…

How to show image in vue.js sending image info from laravel

I am trying to retrieve image from database using Laravel and show it in vue.js. But it does not work. This is how I saved Image public function savePatientProfilePicture(Request $request){ $pictureInfo = $request->file(‘pic’); $picName = $request->id . $pictureInfo->getClientOriginalName(); $folder = “patientImage/”; $pictureInfo->move($folder,$picName); $picUrl = $folder.$picName; $user = new User(); $patientPic = User::find($request->id); $patientPic->image = $picUrl;…

Edit and Update functions in Laravel 5.8

I am getting an error which says “Property [id] does not exist on this collection instance. (View: C:\newXampp\htdocs\testUser\resources\views\Stock\edit.blade.php)” This is my Controller public function editStock(Stock $id) { // $Stock = Stock::find($id); return view(‘Stock.edit’, compact(‘Stock’, ‘id’)); // return response($stock); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\Stock…