Questions tagged [laravel-controller]

218 questions
1
vote
1 answer

Laravel Many-To-Many relationship with multiple functions

I thought I was going quite well in developing my Laravel skills, but it seems I am stuck and can't find the solution online yet. My project is set up in Laravel and Vue and I am trying to store a product with ingredients. The products are in the…
TheLD
  • 2,211
  • 4
  • 21
  • 26
1
vote
3 answers

Executing function before every controller request

I'm calling cloud APIs using token authentication with php-openstack-sdk. $openstack = new OpenStack\OpenStack([ 'authUrl' => '{authUrl}', 'region' => '{region}', 'user' => [ 'id' => '{userId}', 'password' =>…
chopz
  • 381
  • 1
  • 5
  • 21
1
vote
1 answer

Laravel 5.7 Cannot Declare Class Name in Use

I'm trying to make multiple auth in my website; I'd like one view for the log as a user and another to log as a client. I have a users table, and I create a client table with code instead of mail and mtpass instead of a password.…
1
vote
1 answer

Php 7.1 Return Type-hint failing in Laravel 5.7

I just cloned a repository for a project I was working on. Don't quite remember the specifics of the previous machine it was running on but on this one it's using php 7.1 and I upgraded to Laravel 5.7. The issue is that in my previous machine, this…
MrCujo
  • 1,218
  • 3
  • 31
  • 56
1
vote
1 answer

Refreshing a List Sent From a Controller When Posting Data to DB Using Ajax

I'm trying to add functionality where users can add items to a cart without refreshing the page using Ajax. I succeeded while posting data to the database, but I can't refresh the list automatically (after the data gets…
1
vote
1 answer

Array to String in Laravel Ajax Data

I am sending my data to a controller by Ajax, but on the back-end, I'm getting Array to string conversion. Controller $request->get('image_alt') …
mafortis
  • 6,750
  • 23
  • 130
  • 288
1
vote
1 answer

Laravel - PHP - Unable to toggle two forms in a single view

I have a single view dashboard.blade.php. It's having multiple forms. I have set the data attribute data-toggle='collapse in an element. This is working properly for a single form when using the keyboard arrow down method. When click on that…
1
vote
4 answers

Returning same variable to every controller in laravel

I need to send the same result to almost every view page, so I need to bind the variables and return with every controller. My sample code public function index() { $drcategory = DoctorCategory::orderBy('speciality', 'asc')->get(); …
Delowar Hossain
  • 375
  • 1
  • 3
  • 19
1
vote
1 answer

Method break after calling function in same controller

I made a method that handles image. The problem is I want to call that method in my Edit method few times because there are 3 buttons for uploading image. But after calling my method for IMAGE the EDIT method just stops after first image. How can I…
Nemanja
  • 119
  • 1
  • 3
  • 16
1
vote
1 answer

Resource interpreted as Document but transferred with MIME type application/json,laravel

I'm trying to retrive data from a database but I get the error “Resource interpreted as Document but transferred with MIME type application/json: "http://127.0.0.1:8000/"”. Page loads with JSON…
brain pinky
  • 359
  • 1
  • 4
  • 17
1
vote
0 answers

how to customize forgetpassword controller in laravel

in my database user table doesn't have email in it , email exist in another table . so when user what to reset password i want to validate mail entered by user which means i will customize forget password controller to validate email in the other…
brain pinky
  • 359
  • 1
  • 4
  • 17
0
votes
2 answers

Laravel 10 custom login/registration not going to dashboard page

I am trying to make my own custom laravel 10 login/registration because i didn't want to use the breez package because i wanted to learn how do you make a login/registrasion by yourself. But I cant seem to get past the authentication of the…
Cas_R
  • 3
  • 1
0
votes
2 answers

Action Redirect with resource controller laravel - Gives error Action app\Http\Controllers\PostController not defined

Hello I am trying to make a basic CRUD app. I keep on getting the error "Action app\Http\Controllers\PostController not defined.", but I am not sure why. I am trying to redirect to the PostController after my auth checks the email and password so…
0
votes
1 answer

Laravel: Updating data with modal in table

I have an edit button in every row in a table that opens a modal form to edit a user's information. I want to fill in the inputs with the data of the specific user I chose to edit from the table. Though I am having issues actually displaying the…
0
votes
2 answers

How to calculate and display sum total balance into main account from three different balance section (sign-up bonus, deposit, referral ) in LARAVEL?

I want to display the sum total of all credit activities in a user account as his main account balance. I have three different wallet, bonus, referral and deposit and will like to sum up all of them together. This is already being recorded…