Questions tagged [laravel-controller]
218 questions
0
votes
1 answer
Laravel: Database is not storing my image but showing me only array
I am new to Laravel. I have been trying to save an image to the database. Here is my controller method that I am trying for storing the image
public function store(Request $request){
//validation for form
$validate=…

Zeed Tanue
- 91
- 5
- 24
0
votes
1 answer
add delete function for ajax search results
I am trying to make a dynamic table with ajax/jquery.
After the search results are displayed, I want each row to have actions like edit and delete that will be responsible for each entry. This my controller method
public function search(Request…

Jane Doe
- 1
- 2
0
votes
2 answers
Laravel - Routes: Controller nested controller
My routes:
Route::apiResource('courses', 'CourseController');
Route::apiResource('courses.classrooms', 'ClassroomController');
List: php artisan route:list
api/v1/courses/{course}
api/v1/courses/{course}/classrooms/{classroom}
My question is: all…

Thiago Valente
- 673
- 8
- 25
0
votes
1 answer
0
votes
0 answers
getting 500 server error while sending data to database through controller from vue
I am trying to send some data from my vue component to database using a laravel controller. To avoid blank input error, I already made all my table columns nullable except the ID. Still when I am trying to send the data using post method, i am…

Rafaeatul
- 43
- 8
0
votes
1 answer
Generate 3 record or none Laravel Controller
I have a problem with a store () in a controller of a form, I am generating 3 records in the same controller, but if the last one fails because I miss some field of the form the other 2 if they register but I want all or none are saved
$company =…

Ricardo Jesus Jarquin Perez
- 2,029
- 2
- 10
- 17
0
votes
1 answer
Sorting collections in Laravel
I've got a little problem with my Laravel controller and sorting it:
public function index()
{
$achievements = Achievement::all();
$news = News::all();
$livingspaces = Livingspace::all();
$therapies = Therapy::all();
$events =…

n1ghty
- 19
- 9
0
votes
2 answers
Laravel Controller not found
I'm learning laravel and I've tried to create a Controller.
I'm really new, so, please, elaborate.
I've used the following command to create the Controller
php artisan make:controller Api/EstadoController
So, EstadoController is under…

Alan Godoi
- 657
- 1
- 12
- 39
0
votes
3 answers
Laravel command that now needs to be "available" via http
I have a web app created in Laravel that takes credit card payments.
Every day a scheduled command that I created runs to take "today's" payments (basically it submits one http request for each pending payment to the payment gateway).
Now I need to…

TJ is too short
- 827
- 3
- 15
- 35
0
votes
0 answers
How to sync 3 values using laravel sync() in many to many relationship
I need to sync 3 values in a table in which, I have 3 fields in a table as difficulty_level_id, sbj_type_id and subject_id and I have setup this thing in my Controller as:
public function store(Request $request)
{
$difficulty_level =…
user10960234
0
votes
2 answers
Show List of User Names in List With Laravel
I have been having a problem with this for hours now, and I don't know what is wrong. I am trying to make a list of registered users in Laravel but it keeps giving me the error:
"Undefined variable: users (View:
…

Javaprogrammern00b
- 21
- 1
- 5
0
votes
4 answers
update database value on laravel
does laravel have short cut for $i++; i want to update my database value went seomething happend. on php i could just use sql like
UPDATE goods SET qty++ WHERE id = '4'
here is my controller code
public function store(Request $request)
{
$g…

Martin Christopher
- 389
- 1
- 7
- 21
0
votes
1 answer
Creating and Accessing the Helper in the Controller
I've created a helper file in App folder named as Helper.php.
app/Helper.php

ManojKiran A
- 5,896
- 4
- 30
- 43
0
votes
1 answer
Dynamically Map Routes in Laravel
Are there any solutions to make Laravel routes dynamically call the controller and action? I couldn't find anything in the documentation.

Kamran G.
- 463
- 2
- 5
- 16
0
votes
1 answer
Dynamic Select Input in Laravel/Ajax
Why can't I get the Ajax request? I have a ProductController with a create() method.
public function create(Request $request)
{
$value = $request->get('keyname') ? $request->get('keyname') : 1;
$companies = Company::all();
$categories =…

Dito Khelaia
- 138
- 1
- 11