Questions tagged [laravel-controller]
218 questions
0
votes
1 answer
Ajax_JQUERY and Laravel Controller?
I am new in Laravel,i need to add edit and show button via in Controller here is my controller

inasar
- 51
- 1
- 8
0
votes
3 answers
Fetching data from two tables in Laravel in show function in controller?
I have two Model, School, and Student the relationship is, School has Many Student
//Student Model
public function school()
{
return $this->belongsTo('App\School');
}
and same in School Model the following is the function for…

inasar
- 51
- 1
- 8
0
votes
2 answers
SQLSTATE[HY000]: General error: 1364 Field 'firstname' doesn't have a default value (SQL: insert into `users` (`email`) values (test@test.com))
I am new to Laravel framework.
I am facing an issue, with migration of User table.I added nullable to 'firstname' of my table, which works but displaying the same error for 'lastname'column. I have included nullable() to every column, which is not…

Greeshma Nimmala
- 61
- 2
- 8
0
votes
1 answer
how to do Role Base Access in Laravel?
I am new in Laravel How to do in laravel role with the following table
$table->id();
$table->string('name');
$table->string('email');
$table->timestamp('email_verified_at')->nullable();
…

inasar
- 51
- 1
- 8
0
votes
1 answer
laravel - I try to delete row out of a table from the database with a href icon
So what I'm trying to do is delete a row from my database table with a icon button (href)
Here is my…

Plance Development
- 45
- 1
- 1
- 13
0
votes
0 answers
Edit and updating fails for joining table in Laravel 7
I have two tables (City and Area). The city has many areas. So I have successfully added and deleted the data. But I am facing multiple errors while editing and updating. I have just started learning Laravel. I used a resource controller but…

Tusher
- 23
- 8
0
votes
3 answers
Apps route redirecting the wrong URL
------Platform Laravel 7x. --------
I am stuck in a simple problem. I can't find the error. While I am updating a form, it redirects to a wrong URL which I don't want and data doesn't update.
Form action url:
method="POST" action="{{'city/update/'.…

Tusher
- 23
- 8
0
votes
1 answer
How to return a specific value from the database on View from Controller in Laravel?
I am trying to return a specific value from the database on View(activate_id) from AdminController but it returns nothing.
web.php
Route::get('/activate-id', 'AdminController@activateId')->middleware('role:admin');
AdminController.php
public…

Vinayak Sahu
- 3
- 3
0
votes
1 answer
Is it possible to redirect your Laravel blade at a particular time?
Please am trying to redirect a page in Laravel7 once a time is clocked e.g once the time is 04:05 the page should redirect.
I tried this below but it didn't work.
public function countdown(){
$currentdate = date("d-m-Y h:i:s");
…

Olu-Stephen
- 39
- 6
0
votes
1 answer
How to redirect back to preivous template with both input and collections of Eloquent in Laravel?
I need to pass both input and collections, that this controller produce, to the previous template. I try to use:
return redirect()->back->withInput()->with('userdata',$userdata);
but get undefined variable when access $userdata in template. This…

Josh Chang
- 45
- 2
- 11
0
votes
3 answers
Laravel add more than 2 parameters in controller
In my controller I currently give 2 parameters to the view like this:
return view('home')->with(['listings'=>$listings, 'featured_listings'=>$featured_listings]);
But when I add a third parameter it gives me the following message:
Too few arguments…

Max
- 357
- 1
- 6
- 16
0
votes
1 answer
Laravel: Give Authorization to Managers and Interns Roles
My application have different roles as managers interns and accountant. I have a profile page that is now accesible to all the users (all interns managers and accountant).
Now I want the profile to be accessible only to managers and interns whose…

Riwaj Chalise
- 637
- 1
- 13
- 27
0
votes
1 answer
How can I add Laravel Crinsane cart data as an order?
In order to create an order from Crinsane based cart and associate it to the (authenticated) user, I created Order model and tried the following in order controller.

Riyaz
- 19
- 1
- 8
0
votes
2 answers
How to run FFMPEG in laravel project
I can run this code via cmd. And my question is how can I run this command to my laravel project locally and also to my live server?
ffmpeg -i input1.webm -i input2.webm output.mp3
Thanks in advance.

Jin
- 153
- 2
- 12
0
votes
2 answers
How to send variable from blade to controller without changing the url
In blade I have a list of books. I want to choose a specific book to show its information. And to do so I want to send with href the id of the book to my controller passing through route.
For example i have