#### Category : illuminate

I’m working on this Laravel project but I’m running into this error that I don’t know how to fix. When I try to a function called addNote, it gives me a 405 error saying that the function is not allowed. When I visit the error page however, it gives the error No query results for ..

I’m working on a php project and need to use the Collection namespace from Illuminate. I have Laravel installed on my computer. However, when I try and create a new collection with: use IlluminateSupportCollection; … $collection = new Collection(); It gives me the error that it cannot find the class "IlluminateSupportCollection." I tried moving my .. Read more Our company’s CRM/ERP is a bit old and we are actively working on it. But we are planning to migrate to laravel soon. I had chance to migrate some illuminate packages into project to help this migration (So i don’t need to rewrite all). I used https://github.com/mattstauffer/Torch/ for "how to"’s. Now I have to trigger .. Read more I am using the following trait to generate UUID’s for my user model. I have setup a listener to the following event: IlluminateAuthEventsLogin. This works when you just normally sign-in to the app (using Laravel Breeze). But when I manually do auth()->user($user) I get back an instance of IlluminateFoundationAuthUser where the keyType is an integer ..

i am creating a php project for myself and it is not on laravel, i install illuminate/database package on my project for using elequent and its work perfectly. now i want to use laravel routing system in my project but can not find any Instructions for this is there any way to use that? Source: ..

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 === ” || count($value) === 0) { return $query; } return$query->whereIn($field,$value); } a pretty simple ..

I’m trying to make a post http request using IlluminateSupportFacadesHttp. My request : $response = Http::post($this->api.’/auth’, [ ‘auth’ => [ ‘username’ => $this->username, ‘password’ =>$this->password ] ] )->json(‘response’); While api,username and password are set in a __construct method. This request is working well in postman. But when I run it on php server ..

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 value (the key ist lost in the process). Why? What is going on ..

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’)) {$builder->where(‘sub_district_code’, $subDistrictCode); } if ($districtCode = $request->getParam(‘district_code’)) {$builder->where(‘district_code’, $districtCode); }$areasCount = $builder->count(); if ($limit = $request->getParam(‘length’)) {$builder->limit($limit); } if ($offset = ..

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 SymfonyComponentHttpKernelExceptionMethodNotAllowedHttpException: The GET method is not supported for this route. Supported methods: POST. in file C:xampphtdocsprojectscontrollercontrollerapivendorlaravelframeworksrcIlluminateRoutingAbstractRouteCollection.php on line 117 and when i try to to change the request ..

i can count files in the folder with this : IlluminateFilesystemFilesystemFile::files($path) then i can count all files in all subfolders (with specific storage) foreach ($directories as $directory) {$path = Storage::disk($this->disk)->path($directory); $files = IlluminateFilesystemFilesystemFile::files($path); if ($files) {$count += count($files); } } } i can count all files in this folder How can i count .. Read more I would like to override ‘subject’ method in IlluminateMailMailable.php class in such way, that every email that is sent out of the application has a certain prefix ‘[Something]’ in front of mail subject. My first approach was to create CustomMailable.php that extends IlluminateMailMailable.php , customize subject method, edit stub needed for artisan make:email command to .. Read more 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 = Account::find($gook->karmable_id);$request->email = $acc->email; if ($this->attemptLogin($request)) { return$this->sendLoginResponse($request); } But it doesn’t update the request, and login attempt goes with the previous email .. Read more 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. whereHas(‘sizes’, function($query) use($minParam,$maxParam) { if($minParam &&$maxParam) { $query->whereBetween(‘max_capacity’, [$minParam, $maxParam]); } elseif($minParam) { $query->where(‘max_capacity’, ‘>=’,$minParam); } ..