#### Category : php-8

Using Laravel, my kernel file has my $routeMiddleware property array as normal. protected$routeMiddleware = [ ‘access’ => AppMiddlewareAllowAccess::class, ‘auth’ => AppMiddlewareAuthenticate::class, … is being changed to this run I run fixer: protected $routeMiddleware = [ ‘access’ => AppMiddlewareAllowAccess::class, ‘auth’ => AppMiddlewareAuthenticate::class, … My fixer rule set looks like so:$config->setRules([ ‘@PSR2’ => true, ‘array_syntax’ ..

I am working on an old complicated MySql query and I need to write this in Laravel Elequent. SELECT count(relation.id) as amount, IF (relation.type!=2,YEAR(NOW()) – YEAR(if (relation.birthday=0,null,relation.birthday)) – (DATE_FORMAT(NOW(), ’00-%m-%d’) < DATE_FORMAT(relation.birthday, ’00-%m-%d’)),null) as age FROM relation WHERE (relation.stopdate IS NULL OR relation.stopdate>’2021-10-04′) GROUP BY age ORDER BY age I have tried different ways. For ..

I am using Laravel Spark Next and I am trying to create a free plan. My application is charging users "Per seat" (# of projects) The free plan, however, will always have one free project included. That means I need to offer two plans: one free and one paid In my SparkServiceProvider, I have added ..

i installed composer and have php 8 but after creating first laravel project, am facing this error. Where ever i make project, i face this same error PHP Warning: require(C:Program Filesxampphtdocslaravelmyappp/vendor/autoload.php): Failed to open stream: No such file or directory in C:Program Filesxampphtdocslaravelmyapppartisan on line 18 PHP Fatal error: Uncaught Error: Failed opening required ‘C:Program ..

A lot of pieces to this so here’s the meat. Code very slightly tweaked for brevity. Extended class: <?php namespace AppHttp; use IlluminateHttpRequest as LaravelRequest; class Request extends LaravelRequest { } Middleware: <?php namespace AppHttpMiddleware; use AppHttpRequest as CustomizedRequest; use Closure; use IlluminateContractsFoundationApplication; use IlluminateHttpRequest; class CustomizeRequest { protected $app; protected$customizedRequest; public function __construct(Application ..

On my shared hosting server I recently upgraded my PHP version and also on my project in composer.json it all worked fine in the local server but when I tried to run php artisan after pulling the code on the shared hosting server I got the error given below: I researched but I got to ..

I migrated my PHP version from 7.13 to 8. After that I found header and footer is not showing. I tried with latest MPDF versions but still not working. Sourc..

When a user clicks on the link in my mail it will be forwarded to the signed url I created. The controller method looks like this: public function show(Request $request) { //Remove default sendinblue query parameters foreach (array_keys($request->all()) as $key) { if (! in_array($key, [‘expires’, ‘signature’])) { $request->server->remove($key); } } if (! $request->hasValidSignature()) { return .. Read more I’m newbie in Laravel, and follow a free course in Laracast. This is link of my course (episode 11 at 2:49s) "https://laracasts.com/series/laravel-8-from-scratch/episodes/11". Summary of my problem: I’m trying to make my code more declarative with what i wan’t to do (more specific is make a class name: Post, and a method: find() inside this class). .. Read more Inheriting variables from the parent scope is not the same as using global variables. Global variables exist in the global scope, which is the same no matter what function is executing. The parent scope of a closure is the function in which the closure was declared (not necessarily the function it was called from). See .. Read more I am trying to implement reset password in laravel 8 where i have used Livewire and I am receiving the following error: ErrorException Attempt to read property "name" on null (View: /opt/lampp/htdocs/Qwarqo/resources/views/navigation-menu.blade.php) error line <div class="flex items-center px-4"> @if (LaravelJetstreamJetstream::managesProfilePhotos()) <div class="flex-shrink-0 mr-3"> <img class="h-10 w-10 rounded-full object-cover" src="{{ Auth::user()->profile_photo_url }}" alt="{{ Auth::user()->name }}" /> .. Read more When i run api server throw 500 http error and body is; { "message": "Server Error" } It happen when i call more api in one page i call 10x api in same time and i got this error. My server is ubuntu 20.04 and i run php 8 and laravel 8. I have very .. Read more Context I just finished developing an internal business application using Laravel/Jetstream with Inertia which uses a Model Broadcaster with Ably integrated for desktop notifications. Everything was working perfectly locally so I pushed live this afternoon. I have everything migrated and what appears to be setup properly, with https working. The server is a LEMP droplet .. Read more I am working on a new project using Laravel 8. I only have 2 routes at the moment. My first on "/" works but my second "/pricelist" returns a 404 and I have been trying everything for the past 2 hours to get it working to no avail. Any help would be appreciated at this .. Read more I need to create a laravel project that connects to an ODBC database. I installed andreossido/laravel-odbc But It seems to have compatibility issues with PHP 8. I really need to get this going as fast as possible. I followed the guide and got everything configured. I made a test script with a simple fetch and .. Read more I have an issue with the time returned from my database, everything is 2 hours in the past. I’ve been troubleshooting this issue for a bit, and checked the following: /etc/php.ini is only ini in use and has date.timezone = Europe/Amsterdam.(also restarted apache) Laravel’s app.php config has ‘timezone’ => ‘Europe/Amsterdam’. I ran config:clear and config:cache. .. Read more I’m trying to create a custom collection of a specific type of Data Transfer Objects. I’m using the "spatie/data-transfer-object" package. Here is a test class I’m using to debug this issue that popped up within the last few days. namespace AppDataTransferObjects; ​ use IlluminateSupportCollection; ​ class TestDTOCollection extends Collection { public function __construct($items) { $DTOs .. Read more I’m using beyondcode/laravel-websockets as socket server . I recently noticed that no message is sent to the user by the server except when the server is stopping. The connection is successfully upgraded to web-socket, By turning on APP_DEBUG = true I can see that the desired messages (connection established) are written in the console, But .. Read more I’m using beyondcode/laravel-websockets as socket server . I recently noticed that no message is sent to the user by the server except when the server is stopping. The connection is successfully upgraded to web-socket, By turning on APP_DEBUG = true I can see that the desired messages (connection established) are written in the console, But .. Read more After migrating Laravel 8 app to PHP 8 I was no more able to run composer update or install. I receive the following error: Your requirements could not be resolved to an installable set of packages. Problem 1 – Root composer.json requires nunomaduro/larastan ^0.7.6 -> satisfiable by nunomaduro/larastan[v0.7.6]. – Conclusion: don’t install symfony/process 5.2.x-dev (conflict .. Read more , I have a question, how do I make a (.php) file that has an array that manages the system colors, such as (background, color, border color)… because I am making a system for companies , and when the company logs in the system updates itself with the company colors.. for example, a company that .. Read more I want to extract data with null object when didn’t set. Validator Object is: ["data"=>"string"]; ["data"=>$data]=$request->all(); When i use like that i get this error: Undefined array key "data". How can read unrequired objects ? Sourc.. Read more is there an alternative? usually in the context with laravel people have to do a lot of return view(‘myfiel’, [ ‘a1’ =>$a1, ‘a2’ => \$a2]) which is tedious. with compact it is return view(‘myfiel’, compact( ‘a1’, ‘a2′)) personally? compact is less readable. Isn’t there a way to do this "nicer"? Sourc..