Questions tagged [laravel-controller]
218 questions
-1
votes
1 answer
LRAVEL 8 paginate does not exist, i need select data by region_id and paginate it
I found the paginate() method in the Laravel documentation. However, it doesn't work when I implement it. I get an error that paginate does not exist. I know paginate is maybe only for all(), but I need only a few columns, and I need to select the…

Tom_hutka
- 15
- 4
-1
votes
1 answer
create() must be of the type array (mailtrap error in laravel)
I am building a complaint management system and I configure mailtrap in laravel to send mails. What I want is when the user adds a new complaint then there will be automatically sent a 'new complaint' email to the admin. I wrote a simple code in the…

Talha Maqsood
- 195
- 1
- 13
-1
votes
2 answers
Can I use same controller name 2 or more times in laravel?
I have same controller name(suppose Login.php) in 2 different folders in laravel 8 project. In route it is showing error if I use them in following way.
use App\Http\Controllers\my_controller1\Login;
use…

user2729017
- 77
- 1
- 8
-1
votes
1 answer
Call a controller with a parameter?
Let's imagine I have two Models:
A list of users User
A list of marbles Marble which belongs to one User
I would like to fetch all the existing marbles with api/marbles and only my marbles with api/user/marbles. The idea is to avoid a route named…

nowox
- 25,978
- 39
- 143
- 293
-1
votes
2 answers
How do I get info from a table with data from another table?
I have a from group row with a dropdown that automatically fills with data form the table "clients".

Plance Development
- 45
- 1
- 1
- 13
-1
votes
1 answer
How to check whether array elements are empty in Laravel?
I am storing data from a form through an array to mysql database. Now I want to alert the user if he missed any field. So how can I alert him?
public function store(Request $request)
{
$holiday = array (
'firstname' =>…

anonymus
- 161
- 4
- 12
-1
votes
1 answer
How to create laravel multiple joins with count and display all data
In the Below Code i was using multiple table joins and i have multiple rows with the same id from the table clients_topup table while i need to count multiple rows from the table and display all data from the other two tables
in the below code i…

praveenkumar N
- 19
- 6
-1
votes
3 answers
What is the difference between controller types of Laravel?
I found nothing about definitions/differences between resource and plain controllers.
What is the difference between them?

Phree
- 29
- 6
-1
votes
1 answer
Redirected to another page while accessing home page
When user registers in the app, the app is showing a user detail form to complete the profile instead of Dashboard(homepage). Only after the completion of the User profile, user can see the Dashboard.
After registration we are setting a session…

Puneet Kushwah
- 1,495
- 2
- 17
- 35
-1
votes
1 answer
Write function in controller below controller class?
Is that a good practice to wrap some code from controller class method because it's too long and put that code in another custom function below controller class.
Here is controller method:
public function store(UploadRequest $request)
{
…

Denis2310
- 939
- 1
- 15
- 41
-1
votes
1 answer
How to Create Controller Comments in Sublime of Laravel Project?
How to Create of the Type of Comments In Laravel Controller in Sublime Text 3 ?

Chirag_php
- 75
- 1
- 3
- 13
-1
votes
1 answer
Laravel Route for Search
I try this tutorial on laravel about Live Search
But it's on the homepage(index)
I want to access it to localhost/laravel/public/search
Here is the Controller
class SearchController extends Controller
{
public function index()
{
return…

roy phil
- 17
- 1
- 6
-2
votes
2 answers
Laravel Namespace Resource Controller Routing
I was working on a laravel project. The following is the code of my UserController:
-2
votes
2 answers
Cant return $couponDetails->couponName; value in laravel
$couponCode = $request->couponCode;
// Get coupon details by coupon code
$coupon = Coupon::where('couponCode', $couponCode)
->get()
->first();
$couponDetails = response()->json($coupon);
return $couponDetails->couponName;
That returns…

Madusha Prasad
- 81
- 9
-2
votes
1 answer
in laravel , what is the differace between Route::resource and Route::get?
in laravel 9 , what is the difference between
Route::resource('/blog',[PostController::class);
and
Route::get('/blog',[PostController::class,'index']);
?

Lab Devices
- 43
- 1
- 6