Category "php"

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

PHP using str_starts_with for array to exclude same as with wildcard

This is my ignore list which i have some item that i don't into that $ignoreRoutes = [ 'administrator', 'attachImage', 'login', 'logout', 'l

Laravel: Schedule a job or an artisan command?

I have a Product model with id,name,price. The price value is stored in an external API and i need to fetch it every minute in order to update it in the databas

Laravel 5.5 file_put_contents permissions issue

I have a new Laravel project, with Passport and basic authentication installed, and I am getting this error when I try to call the built in /api/register endpo

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

I am writing a code in PHP where i need to call and API (Sending username and password) and then fetch the authorization value. I tried some solutions which are

Wordpress wpdb->delete issue

I'm trying to delete a record from the database programmatically. When I have it hardcoded like this it does delete a record from the database: $wpdb->delet

Laravel unique validation on multiple columns

I have 2 columns in table servers. I have columns ip and hostname. I have validation: 'data.ip' => ['required', 'unique:servers,ip,'.$this->id] This