Category : php-8

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 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

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

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..

Read more

How can i add number in id converting it into there value by relationship. This is my code by which i wanted to add the price @foreach ($users as $user) @if ($user->utype == ‘USR’) <div class="row" style="border: 1px solid black"> <div class="col-1" style="border: 1px solid black">{{ $user->id }}</div> <div class="col-7" style="border: 1px solid black">{{ $user->name ..

Read more

This is my php code where i want to show value after getting added. @php foreach($orders as $order) { if($order->order_by == $user->name) { $ites = str_replace(‘,’, ‘+’, ‘$order->product’); $items = explode(‘,’, $ites ); foreach ($items as $item) { foreach ($products as $product) { if ($item == $product->id) { echo $product->price . ‘+’; } } } ..

Read more

Using Laravel 8 with PHP 8, and trying to set up optional parameters in routing: Route::prefix(‘manual’)->group(function () { Route::get(‘/{type}/{topic?}/{subtopic?}’, ‘[email protected]’) ->name(‘manual’); }) controller (tried both false and null): public function manual($type, $topic = false, $subtopic = false) { gives the following error: SymfonyComponentDebugExceptionFatalThrowableError Cannot use positional argument after named argument when I call this route ..

Read more

hello friends I want to ask, why the data is not deleted? I have clicked on it but in the database it is not deleted. My php version 8 migration public function up() { Schema::create(‘role_akun’, function (Blueprint $table) { $table->id(); $table->string(‘nama_role’)->unique(); $table->string(‘roles’); $table->timestamps(); }); } controller in function destroy public function destroy(ManageROle $manageROle) { $manageROle->delete(); ..

Read more

I’ve just upgraded my (Windows 10 2004) system from PHP 7.4 to PHP 8.0.3. I did this by uninstalling then reinstalling XAMPP with the later version. I am developing a Laravel 8.0 application in VS Code v 1.55, and the application runs absolutely fine. However, every single namespace/use statement in every single .php file has ..

Read more

I have the following request validation rules in an controller. public function __invoke(Request $request) { $this->validate($request, [ ‘name’ => [‘required’, ‘unique:games,name’, ‘string’], ‘variant’ => [‘required’, ‘string’], ‘rules’ => [‘string’], ‘is_anonymous’ => [‘boolean’, ‘required’], ‘message_mode’ => [‘required’, new EnumRule(MessageModeEnum::class)], ‘powers’ => [‘required’, ‘array’], ‘powers.*’ => [‘distinct:ignore_case’, ‘required’, ‘string’], ]); } Below is the test I’m running ..

Read more