I have to make an online shop website and I have to make multiple image uploads inside my product’s form and then display it as a slideshow in my view. I tried 5 tutorials or their concepts and nothing works. I’m so frustrated, so if you guys know anything, hit me up. I’m hoping to find simplest and straight-forward way
Tag: laravel
BadMethodCallException: Call to undefined method AppModelsUser::getFirstMedia()
I am trying to do: $this->assertFileExists($user->getFirstMedia()->getPath()); In my test. But when I run it I get this error: BadMethodCallException: Call to undefined method AppModelsUser::getFirstMedia(). I do: And I also do: As far as I know I am using the right traits. What am I doing wrong here? EDIT: My test: My store method controller code: Answer You are implementing your
Laravel Transactions Not working when this condition happenes
Let me start with my code On my Controller file this is the code } Notice I am using a service there, The service is nothing but a namespace to manage the code in the service class this what happening Now the issue is when I get some error in the service and I resend the data then suppose the
How to automatically number each row in a table in laravel?
Please I want to automatically number each row when data is displayed from the database. Something like this so each row is numbered in ascending order from 1 to n depending on the data available in the database. How do I properly do that. Any Help please am new in laravel Answer If you are using blade, the laravel’s automatically
Can you send text and file for the same param?
I am trying to send a request to my PHP Laravel API that would store as “content” both files and text, however when i send the POST request, only the file path gets saved in the database and the request returns an array that is empty, is the problem from postman or my API? Here is the code for my
Laravel, store multiple variables from array into DB
Im not sure if the question title is correct but what I wanna do is clear in the example below I have 3 arrays and I want to store data in one table the table structure is like this table name: tour_transports id transport_id transport_track transport_note arrays coming from blade so as you see the ids are 1 and 5
Laravel 8 – Multi Auth with two diffirent registration form?
I’m using laravel breeze as auth scaffolding package I want to know How can I create two diffirent registration form for two User Types here is a simple explanation of hwat I want to achieve: resources/auth/developer : developer-register.blade.php resources/auth/designer : designer-register.blade.php if the Visitor choose to register as “developer” it will display a diffirent form. and same thing for if
How do retrieve imploded images and display in slides from database in laravel
I am trying to retrieve imploded images from the database in Laravel and display it in slides using foreach loop statement. Stored Images in database colomn controller $post= DB::table(‘posts’)->…
How to display a table according to a foreign key which is display from another foreign key / Laravel 6
Model: public function followup() { return $this->hasMany(‘AppFollowUp’, ‘id_log’, ‘id’) ->select([‘id’, ‘id_log’, ‘request’, ‘id_priority’]); } follow_up.id_priority is a foreign key …
Is there a better way to get the 12 months base from the current month and year in laravel using carbon
I have a graph like the attach image below. How should we fetch 12 months base from the current month year? Here’s my implementation for the complete 12 month period with month and year filter. Ignore other variables, just look the filter for fetching months. But this only get the complete 12 months of the current year. I want to