212,682 questions
0
votes
0
answers
24
views
How do you move the function definition for the ->when() function in Laravel Eloquent Models?
so I'm building a way to organize Items based on different requests:
$items = Item::query()
->where("type", $itemType)
->when($mode, function (Builder $query, $...
-1
votes
0
answers
32
views
When client opens it from browser history it opens JSON return not a component [closed]
I have problem with all Inertia projects. When the user opens the page from their browser history it opens a JSON not a React page.
How can I prevent this? I have:
"dependencies": {
&...
0
votes
0
answers
34
views
Using a prop in an import statement in Vue, using Laravel and Inertia?
I'm trying to dynamically load only specific icons from the lucide-vue-next package in my vue page, however it's not wanting to work. I'm using Laravel 12 (Latest), Vue3 (Latest shipped with Laravel), ...
2
votes
1
answer
63
views
How can ship multiple different sources for the laravel-vite-plugin besides app.js?
Currently the app has 2 entry points for the JS and CSS files in the blade layout file:
{{-- layout.blade.php --}}
<head>
<meta charset="utf-8" />
<meta name="...
2
votes
0
answers
50
views
Storage::putFile() stores file to real disk despite having called Storage::fake()
I have a test which has a setup function that would call Storage::fake() function like so :
public function setUp() {
parent::setUp();
Storage::fake('public');
}
All the tests post an image that ...
0
votes
0
answers
28
views
Query timing out despite making several changes
I have the following query:
$countries = Country::with('place.details')->get();
My website is timing out running this query, even when I set the timeout to 10+ minutes.
I discovered that if I ...
2
votes
1
answer
46
views
PHPStan complains about @var Builder<ProductTemplate> in Laravel Eloquent scope
I'm trying to define a Laravel Eloquent model with a custom scope that filters categories by a related product's vendor_id. Here's my setup:
class Category extends Model
{
public function ...
0
votes
1
answer
37
views
Fail on save record on a modal in button action at header of infolist - filament laravel
Fail on save record on a modal in button action at header of infolist - filament laravel
I have a page view AgendamentoView. That display infolist of an Agendamento (schedule). Each schedule have one ...
0
votes
0
answers
81
views
Setup local SSL certificate for HTTPS in Google Chrome [closed]
I got a Laravel App running on an Apache server. I've configured VirtualHost to locally access the app with URL:
https://www.infoalquiler.com.ar/
Despite the app is working properly, I'm getting a &...
1
vote
1
answer
57
views
Why Image::make of spatie/laravel-medialibrary raised error? [closed]
In laravel 11 app using spatie/image "^3.8" and spatie/laravel-medialibrary "^11.12" I need to get all properties of image and I do
use Spatie\Image\Image;
...
$itemMedia = $...
0
votes
1
answer
97
views
VueJS blank page [closed]
I'm working with Laravel 12 (with Breeze), VueJS, Debugbar, all in their newest versions. My server is running locally on my MacBook, and developing on this MacBook works fine. The app works correctly ...
0
votes
2
answers
53
views
Replace Laravel's default email validation policy
By default, Laravel's email validation does not fail on invalid email, eg 'example@example'.
$data = ['email' => 'example@example'];
$rules = ['email' => 'email'];
$v = Validator::make($data, $...
-1
votes
0
answers
91
views
How to authenticate API routes in Laravel 12 using Sanctum [closed]
I have a route which I wish to protect with a token, using Sanctum.
The offending route is /status, which would be accessed by /api/status.
The /foo route works fine, there is only a problem when ...
1
vote
1
answer
92
views
Why does Laravel read the schema as if it had 2 primary keys? [duplicate]
Here's my laravel composer.json for its version info:
{
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton ...
2
votes
2
answers
105
views
Avoiding redundant data in an Eloquent model Instance
I encountered an issue while working on a Laravel project of mine, intended for property rentals. In the database, both the property owner’s and the tenant’s contact information are stored in the same ...