226 questions
0
votes
0
answers
48
views
GeoPackage Export from Laravel and PostGIS
I have an issue with my exportGeoPackageWithStyle() controller. When I load the exported GeoPackage file into QGIS each feature has no geometry thus their extension could not be found. When I load the ...
1
vote
0
answers
105
views
Why I can't sent the session from a controller to another laravel 11?
I have a resource named categories on my web.php file with the following content:
Route::prefix('admin')->middleware(['web'])->group(function () {
Route::get('login', [AdminLoginController::...
0
votes
1
answer
688
views
passing data through controller via return view in Laravel 11
I am currently trying to learn Eloquent ORM but first I am trying to pass some static data to my Controller.
Here is the snippet of my Controller
SCControler.php
<?php
namespace App\Http\...
-1
votes
1
answer
48
views
Reorganizing controller files in Laravel
In Laravel, I can't find my controller after rearranging the file and folder structure in app/http/controller. I wanted to organize my controller files due to their large number. Here's how it looks ...
1
vote
0
answers
129
views
Undefined Array key "link" error in srmklive paypal package in laravel
I am a newbie. I have a saas project where I have used srmklive paypal package and it has the following code to create a new order. But when I click on the button, it shows an Undefined Array key &...
0
votes
1
answer
404
views
Laravel Dynamic Navbar from Database
Changed the source code so it now works properly.
I created a dynamic navigation for the frontend page. However, I had a little problem with it. When I navigate to the page of one of the entries in ...
0
votes
2
answers
149
views
Laravel: 'Get' Route not calling method in controller
I have a route as:
Route::get('/edit/detail/{modelName}/{rowId}/{persId}',[AddPersInfoController::class,'editPersDetailTabs'])->name('edit_pers_detail');
and I'm calling it from a button in a table ...
-1
votes
4
answers
72
views
Data from controller does not get passed to the view in laravel
I am trying to provide some hardcoded data (for the testing purposes only) from my controller like this
return redirect()->route('admin.my-view.edit', $prop)->withToastSuccess('Success')->...
1
vote
2
answers
82
views
How to make random number with format 25-3456 and 165.09826 in laravel?
I want to create a random number with a format like that which will be used as an invoice number and also a contract number when making transactions, I use the Laravel framework
$request['no_vak'] = ...
0
votes
1
answer
21
views
Grouping and Counting data from part of id in laravel
I have data like this :
TSAB001001
TSAB001002
TSAB001003
TSAB002001
TSAB002002
TSAB002003
TSIB001001
TSIB001002
TSIB001003
TSIB002001
TSIB002002
TSIB002003
I want to display it in blade :
TSA
BOO1
...
0
votes
1
answer
42
views
Can I get same data using POST rote that I got using GET route
I have two routes in my Web.php,
Route::get('/employees', [ApiController::class, 'employees'])->name('employees');
Route::post('/employeesPost', [ApiController::class, 'employees'])->name('...
0
votes
1
answer
341
views
Updating session without reloading page with AJAX Laravel
I am working on a cart system and this is a kind of blueprint I am trying to make work. So whenever the user clicks the Add button session for the specific assignment will be created and listed on the ...
0
votes
2
answers
3k
views
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 ...
0
votes
2
answers
316
views
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 ...
0
votes
1
answer
2k
views
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. ...
-1
votes
2
answers
381
views
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 ...
0
votes
1
answer
831
views
Laravel: Login doesn't redirect to home
I am having issues logging in using Laravel. Every time a user logs in, it redirects them to the post route (a blank page) instead of home, which is the intended route. Even when I login with the ...
2
votes
2
answers
2k
views
Using same controller for web route and api route?
I am working on building API and so far I've familiar with the web route.I was wondering can we share the same controller for both web and API.
I already have a controller file which is working for ...
-2
votes
2
answers
432
views
Laravel Namespace Resource Controller Routing
I was working on a laravel project. The following is the code of my UserController:
<?php
namespace App\Http\Controllers\Backend\Admin\Users;
use App\Models\User;
use Illuminate\Http\Request;
use ...
-2
votes
2
answers
72
views
Cant return $couponDetails->couponName; value in laravel [duplicate]
$couponCode = $request->couponCode;
// Get coupon details by coupon code
$coupon = Coupon::where('couponCode', $couponCode)
->get()
->first();
$couponDetails = response()->json($...
0
votes
1
answer
45
views
How to filter common users from multiple belongstomany relationship pivot tables in laravel
There are table diagram
Sellers table are main table. Services and Areas tables can contain multiple services and areas for spacific Seller. For this I use seller_services and sellerable Pivot table ...
-2
votes
1
answer
540
views
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']);
?
-1
votes
1
answer
40
views
Laravel trying to store image file in 3 different folder
I'm trying to store image in 3 different folder inside public folder now I'm able to store in two different folder but when I added 3rd folder path but it was not coping in 3rd folder help me to solve ...
0
votes
1
answer
1k
views
How to store multiple pdf file into public folder using laravel 8 in controller?
This my data that I want to store my pdf files in my public folders. Anyone can give me any idea?
I tried to foreach the data to get that file but it seems not working in my end. Anyone can help me?
0
votes
2
answers
541
views
I cannot delete data which have many-to-many relationship in laravel 9
I am using PHP 8.2.0, MySQL 8.2.0, and Laravel 9.48.0. This is my database migrations file pivot table (category_menu):
public function up()
{
Schema::create('category_menu', function (...
0
votes
2
answers
113
views
laravel controller returns only 2 values
I have a database with 3 tables. A separate model is connected to each table, and there is a controller that accepts values from all models. On the site page, I will have 3 tables that will be ...
0
votes
1
answer
16
views
How Do I Get Search To Work In Another File?
My issue is I can't get search to work when I use it on a header and want it to work on my orders file. I can not seem to get the input so it gives me a 404 error.
My search on header from ...
0
votes
1
answer
86
views
How to show on view some of the articles depending on their order (Laravel 8)
I want to paginate my mysql database without using the paginate method, in particular i want to show the articles depending on their publication_date row_num, only showing 8 articles per page, i would ...
0
votes
1
answer
82
views
Why am I not able to return a view with ->withInput() and ->with() in Laravel
Why am I not able to return a view with ->withInput() and ->with() in Laravel.
I want to show old input for user when user is making a search and also a flash message. But currently, it does not ...
0
votes
0
answers
1k
views
Laravel's UUID (introduced in 9.3) throwing some errors for Users
I recently decided to upgrade to Laravel 9.3 (from 9.1). I wanted to take advantage of the UUID introduced by 9.3 and get rid of my custom UUID trait. So now my models use:
use HasUuids;
So far so ...
0
votes
1
answer
376
views
Laravel 9: imagettftext(): Invalid font filename
I have a Controller method like this:
public function singleChar($text)
{
$font = 'SansBold.ttf';
...
imagettftext($img, $size, $angle + 5, $textX + 5, $textY + 10, $shadowgbColor, $font, $...
-1
votes
1
answer
1k
views
How to get currently logged in user email from controller [duplicate]
I am trying to get the email of the currently logged in user from one of my controller. I normally get the currently logged in user id from this = auth()->id()
But when I try to get the email the ...
-2
votes
1
answer
84
views
laravel nested controller with 3 model
is possible to use 3 model in laravel nested controller?
this my route now:
...
'supplier' => SupplierController::class,
'supplier.item' => SupplierItemController::class,
...
i want to use 3 ...
2
votes
1
answer
2k
views
Laravel 9 how to pass parameter in url from one controller to another controller?
I was facing this problem of missing parameter when trying to pass a parameter from one controller to another controller. The parameter is $id whereby the data is originally from post method in ...
0
votes
1
answer
382
views
how to calculate % progress based on two tables with where condition
What is the best way to calculate the % progress of the activity based on the completed activity task points and total activity task points at the same time get the total number of activity task
I ...
0
votes
2
answers
1k
views
How Laravel Generate Model Migration Controller all command related files?
after these commands
php artisan make:model 'FileName' -mcs
Laravel make command files sources (Model, Controller, Migration, Seeder, Factory etc...)
How all basic files generate and where from these ...
0
votes
2
answers
3k
views
Unable to send ajax data to Laravel controller
I'm just trying to send the editable table row data to the controller onClick of the Save button, update that data in the database, and return success.
But I cannot display the data inside the ...
0
votes
2
answers
3k
views
Session is not getting saved after page redirect in Laravel Application
I am redirecting the page after a successful login check and the session is created but the session is not available after page redirection.
My Login Controller:
$validated = $request->validate([
...
0
votes
5
answers
3k
views
Method Illuminate\Database\Eloquent\Collection::orderby does not exist
$posts = Post::all()->orderby('created_at','desc')->where('usr_id','=',session('LoggedUser'))->get();
return view('admin.profile',compact('userInfo' , 'posts'));
i am making a custom ...
2
votes
3
answers
301
views
Can not use controller name in laravel, must use namespace
Blade view and PostsController
When I use {!! Forms::open(['method'=>'post', 'action'=>'PostsController@store']) !!}
It errors out.
But when I use {!! Forms::open(['method'=>'post', 'action'=&...
-1
votes
1
answer
618
views
How to update table records, but only form fields that have data in them?
In my controller, I have my create record method, but I want to edit existing records, but only update the fields that are filled out. I try to only fill out one or two fields on the edit property ...
0
votes
1
answer
1k
views
How can I send data from a form into the table in the database?
I have a form that adds a new property listing into the properties table in the db. I keep getting errors that inputs are null and also Laravel isn't grabbing the value inputted into the select HTML ...
1
vote
1
answer
106
views
The array will send only the first element to the database , how to send the array of 3 elements in Laravel-8 controller through API?
$client = new Client([
'base_uri' => 'http://localhost',
]);
$response = $client->request('POST', '/API/customerOrder/createOrder.php', [
'json' =>[
'SKU_QUANTITY' => [9,...
1
vote
2
answers
2k
views
how to access data ($count) from laravel controller to vue component
I want to access a variable $count from my controller and access it to a vue component (frontend). currently have this code on my controller:
public function index()
{
$count = User::where('...
1
vote
1
answer
2k
views
How to show message to the user after email verification in Laravel?
I want to display a message to the user after email verification. Getting an email to email verification after new user sign up to the website. There is a VerficationController. how I can modify to ...
0
votes
2
answers
2k
views
Undefined variable in Blade/view in Laravel
I'm getting $navs is not defined in my Blade view, even though I have it defined and passed to the view by my controller. I am still getting the following error regardless.
ErrorException Undefined ...
0
votes
1
answer
2k
views
My laravel Yajra datatable does not render. It says invalid json response. However I can not read the error since the response is empty
Hello I have the following controller method to return data to my datatable in Laravel,
Controller Method
public function get(Request $request) {
return Datatables::of(AppUser::all())
->...
0
votes
2
answers
877
views
how to paginate read notifications in Laravel
I got an error related to the pagination of read notifications. Thank you for your help.
This is my controller code that gives this error when it runs
public function NotificationsRead(User $user)
{
...
0
votes
1
answer
645
views
laravel withCount() Cardinality violation error when relationship is hasMany
This is my models:
//project model
class Project extends Model {
.....
public function items(){
return $this->hasMany(ProjectItem::class,'project_id');
}
}
//project items model
...
0
votes
1
answer
772
views
SQLSTATE[HY000]: General error: 1364 Field 'seller_id' doesn't have a default value
$product = new Product([
'productName' => $request->productName,
'quantity' => $request->quantity,
'weight' => $request->weight,
'boxes' => $...