Questions tagged [illuminate]

28 questions
0
votes
0 answers

Eloquent: count(): Parameter must be an array or an object that implements Countable

Ok Im using Illuminate on my php project and recently upgrade from PHP 5 to PHP 7.2. I have this scope in my Model Model.php public function scopeWhereInOrAny(Builder $query, $field, $value) { if ($value === null || $value === '' ||…
0
votes
1 answer

Can't make HTTP Post request response: GuzzleHttp\Psr7\Response "Not Acceptable"

I'm trying to make a post http request using Illuminate\Support\Facades\Http. My request : $response = Http::post( $this->api.'/auth', [ 'auth' => [ 'username' => $this->username, …
Snowfire
  • 171
  • 9
0
votes
1 answer

Why does flattening a collection of collections yield into an array of all the arrays values?

Using laravel, I create a collection of collection of array items. I expect to work on each array item during the map by first flattening the collection of collections. Yet instead of getting each array item, I suddenly iterate over each array's…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
0
votes
0 answers

Eloquent query builder got 'BadMethodCallException' when use an attribute of an object as input to where statement

I use Eloquent PHP as ORM and implement query builder for my web applications. Usually, it works when the code looks like this. $builder = Area::query()->limit(30); if ($subDistrictCode = $request->getParam('sub_district_code')) { …
0
votes
0 answers

laravel MethodNotAllowedHttpException get not supported

when i run php artisan route:list i can find the route GET|HEAD | accounting/sales but whenever i send the request using postman i get the same error Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The GET method is not…
Over Dose
  • 21
  • 3
0
votes
1 answer

AWS S3 endpoint issue

This is a really strange one as it started throwing errors over night - it's been working fine up until yesterday - this morning it's been playing all day. I'm using illuminate/filesystem in my project and for the endpoint I was…
0
votes
3 answers

Alter Request parameter(Email) and then Authenticate User in Laravel

I need to change the request parameter i.e. email, and then attempt login with the new email. What I am trying: $user_handle = $request->email; $gook = Gookarma::where('handle', '=', $user_handle)->firstOrFail(); $acc =…
hdrajani
  • 73
  • 1
  • 2
  • 10
0
votes
1 answer

How to remove paginate in Laravel?

I need to remove the pagination and leave everything on one page, but this way I'm doing it only generates BUG. I wonder why the snippet of the commented code doesn't work to remove the pagination. if ($minParam || $maxParam) { $products =…
iLuucasD
  • 1
  • 2
0
votes
1 answer

Laravel | Check that user belongs to all relationships BelongsToMany

I am trying to create a policy for updating a user to ensure that either the person updating or the user being updated belongs to a place. I have the current database structure for the users | id | first_name | last_name | email | password |…
user12789707
0
votes
1 answer

Iluminate database problem with schema builder hasTable method

I've got a legacy codebase making use of the illuminate database components. From the documentation its apparent I should be able to detect presence of a table in the underlying database using the Schema component. This is my attempt use…
David
  • 34,836
  • 11
  • 47
  • 77
-1
votes
1 answer

Laravel 9 - RateLimiter unable to access protected property in Job

I have been trying to queue a job with Laravel 9 and setting a rate limit, to the API I am going to hit. The limit is max 10 requests per minute. My AppServiceProvider.php namespace App\Providers; use Illuminate\Cache\RateLimiting\Limit; use…
IncrediblePony
  • 645
  • 9
  • 31
-1
votes
1 answer

use illuminate/pagination outside laravel

I try to use laravel pagination in my custom CMS the illuminate/pagination work, but not properly this code for my controller work $cats= Category::paginate(2); but when i want to calling the pagination link in this code in blade…
mohammad13
  • 453
  • 3
  • 17
-1
votes
1 answer

How to store \Illuminate\Http\UploadedFile on the public disk?

I want to store an UploadedFile to the folder /storage/app/public. I'm using file->storePubliclyAs(), but it's storing at /storage/app. Using file->storeAs() gives the same effect. Probably that'd be possible using…
user5066707
1
2