Questions tagged [laravel-controller]
218 questions
0
votes
1 answer
Laravel query how to join data from multimple tables
need help to join more than one table in laravel query
Matches table
id
round
league_id
home_team_id
away_team_id
match_date
Match facts table
id
match_id
player_id
minutes
goals
this query gets home and away team players…

Jetz
- 207
- 2
- 4
- 14
0
votes
2 answers
Laravel undefined variable Controller
I have had problems with my BusinessController for a long time now. It is impossible to understand what is not written so. Please help me fix mistakes; I feel I made a lot of them)
My Problem:
my database business_table.php
class BusinessTable…

Mineral
- 39
- 1
- 1
- 7
0
votes
1 answer
Class 'App\Http\Controllers\Controller' not found in Laravel 8
Controller
namespace App\Http\Controllers;
use App\Models\Article;
use Illuminate\Http\Request;
class ArticlesController extends Controller
{
public function show($id)
{
$article = Article::find($id);
return…

Janet Webster
- 19
- 1
- 5
0
votes
1 answer
Laravel custom controller not found when changing the controller directory
When changing the controller directory location like so:
Route::group([
'prefix' => 'report',
'middleware' => 'auth',
], function() {
Route::get('/summary','IOS\ReportController@index');
});
It returns an error message:
Error
Class…

Shah Alam
- 7
- 4
0
votes
1 answer
Handle Exception From Within Method
I am implementing payments for my website using the API of an external service (ie. the service of the payment provider).
Let's say the user clicks 'BUY', and then we go to my controller which says something along the lines of:
public function…

padawanTony
- 1,348
- 2
- 22
- 41
0
votes
1 answer
Laravel7 How to custom the RegisterController to save multiple data when user selected
I am a newbie in Laravel and I need your help.
I'm using the Laravel 7. I have 3 tables in my database.
User to save the registered users
Categories to show in the front-end that I provided for them to choose (multiple)
Vendor_Cat that I collecting…

Jill
- 49
- 6
0
votes
0 answers
Pass Laravel Controller Function in VueJS props
Can someone help me how do I pass this function in Vue "props"?
public function showBusinessIntelligenceModule($store_id = NULL) {
$stores = Stores::findOrFail($store_id);
$reportParams = array(
'date_from' =>…

Matthew
- 11
- 2
0
votes
1 answer
How to +1 day from retrive endDate data in laravel controller?
I want to get enddate by + 1 day
$data=[
"title" =>$event->event_name,
"start" =>$event->start_date,
"end" =>new \DateTime($event->end_date.'1 day'),
"textColor"…

NewComes
- 17
- 3
0
votes
1 answer
Laravel format user's data sent to view
I want to return my user's data with a specific field formatted differently.
Users have a field some_field which contains a string, let's say abcdef. I want to format it like so : ab cd ef - which I can do using wordwrap($user->some_field, 2, ' ',…

Jeremy Belolo
- 4,319
- 6
- 44
- 88
0
votes
1 answer
Laravel sending custom email
I don't know if this is possible
I am trying to send custom email all the users from my users table. I am using the mail fascades present in laravel.
There is a blade template like this :
@component('mail::message')
# New Book Lunch
This is the…

Riwaj Chalise
- 637
- 1
- 13
- 27
0
votes
1 answer
I am getting 500 Internal Error when trying to pass named route with two parameter in my controller
So when I put a route name with a single parameter it works flawlessly but when I pass named route with two parameters I get a 500 error in my console which looks like this:GET…

Nutan Panta
- 59
- 1
- 16
0
votes
2 answers
Routing Error Due to a group prefix in my route
In my routing if i remove the {page} prefix it works completely fine but when i put it i get an error. For other it is working fine but it is not working for this route: Route::get('/{categories}', 'AdminVisible\CostIncludeController@index');
My…

Nutan Panta
- 59
- 1
- 16
0
votes
1 answer
Why am i getting this Non-Object Error when tring to use laravel helper kebab case?
I wanted to turn the package name into url name as well So when i used laravel helpers inside where() in my controller method i get an error:
My Controller:
use Illuminate\Support\Str;
public function package($package){
$converted =…

Nutan Panta
- 59
- 1
- 16
0
votes
1 answer
How to pass a database data instead of array in the controller
In my controller in finorfail it returns array but instead i want pass package name
My controller:
public function package($package){
$package = Packages::findOrFail($package);
return view('pages.package',[
'package'…

Nutan Panta
- 59
- 1
- 16
0
votes
1 answer
Update table DB in Laravel with findOrNew
How I can update table in DB, with use function findOrNew
I want first check column in table. If I have same title not add, if I dont have - push
I campare @title@ in table DB.
public function update(Request $request, $id)
{$news =…

Oleg St
- 9
- 5