Category "php"

ternary operator not working for multiple code

So I am trying to color code if a value is either AWOL, Active, or On Leave I have been looking into ternary since my code is inside an echo already, since the

PHP Startup: Unable to load dynamic library, when running unit tests

when I try to run my unit tests, I get this error PHP Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: \xampp\php\ext\bz2 (The specifie

How to change the "Maximum execution time screen" on Laravel and show a custom message instead

My application has a complex script that when some type of error happens it exceeds the maximum execution time instead of returning the error, that It's okay fo

Laravel display validation error

I try use this code: @foreach($errors->all() as $error) <li>{!! $error !!}</li> @endforeac

Using spatie/media-library, how to rename a collection of uploaded files?

I would like to rename a collection of uploaded files, but when I use addAllMediaFromRequest() I can't retrieve information from the files. In this example; I

How to change PHP-FPM port on Mac

I'm not using php or php-fpm, but it's hogging port 9000. I need port 9000. I'd like to change the port. I changed it in /etc/php-fpm.conf and /etc/php-fpm.d/ww

Laravel Blade checkbox not checked

I'm passing variables into the blade from controller. This is my code from controller: $offerConditionsData = Offercondition::where('offerId', $id)->where('

TradinView problem with reading webhooks and running the page script

I have the following problem: In the TradingView application, I have alarms set and sending them via the URL Webhook to the address http://mpietraszewski.cba.pl

Symfony\Component\Debug\Exception\FatalErrorException Trait not found in Laravel project [closed]

I have create a new trait within my Laravel project, but it doesn't work. First I have created a folder called App\Traits and my trait filenam

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

I moved my project from desk to another. When I run php artisan it does not work. I tried to run composer update, but it returns the error Script @php a

How in Laravel run JavaScript code stored in php variable?

In the livewire component, I have the script tag: <script> {!! $script !!} </script> Let's say the $script variable contains console.log('test'); I

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

I have encoded a token with JWT::encode($payload, $key, 'HS256'); When I am trying to decode it with the same key, it throws an error. Here is the code: <?p

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

I am working on Razorpay integration and after succesful payment when I try to save the details to the database I get an error. I am sending t

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

my connection: $con = new mysqli('localhost', 'root', '', 'test'); it does not work with that either: $con = new mysqli('localhost', 'root', '', 'test'

How to convert a carbon into string, to take the date only?

i have an collection like this 0 => array:4 [ "so" => "SO-1" "product_name" => "EXTREME FORTE - BP" "created_at" => Carbon @1527481346 {#628

Laravel SQL query midnight time not showing

I am making a schedule display system and it shows the schedules of ferries. my problem is if I dont put midnight time in order then query skips midnight time a

How to protect PDF files from being downloaded or copied

I'm developing a new website with PHP & MySQL. The website is for an online eBook library that grant access to its books based on paid subscription plans.

possible options to create pdf file using html elements to generate invoice in php and codeigniter

Hello Everyone this could be the most common question asked on stackoverflow, I have an invoice template in html like this demo page. I want to generate an invo

possible options to create pdf file using html elements to generate invoice in php and codeigniter

Hello Everyone this could be the most common question asked on stackoverflow, I have an invoice template in html like this demo page. I want to generate an invo

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

The code was working perfectly until when I installed XAMPP 8 (PHP 8). if(isset($_POST["submit"])){ @$subject = $_POST['subject']; @$term = $_POST['term