I have a project with laravel and datatable using yajrabox, it stuck in relationship sort this is my kabupaten datatable class and this is my action column. provinsi model and kabupaten model my question are why $id in kabupaten.action return provinsi.id instead of kabupaten.id and i have try The $id return k…
Laravel could not find driver Cpanel
I deployed my Laravel project on Cpanel but there’s an error “could not find driver(SQL)” I’m using Mysql database in Cpanel, and I have checked pdo_mysql in PHP extension. but when I looked on phpinfo(); and find pdo_mysql, the result is 0/0 How to fix this? Thanks in advance Answer T…
ZipArchive::addFile() creates zip files with tree structure in Windows but flattened in Linux
I used PHP’s ZipArchive library to create a zip file to easily transfer images for some e-shop synchronization service from a desktop to the web server of the e-shop. The script I used to create the zip is below: My problem is that when you view the zip’s contents in WinRAR, they are shown normall…
Fetch data from one table and compare with another one basic on contain values
I got 2 different databases and 2 tables Here’s Table.1: and there’s Table.2 but the users ask for all items separately according searching the ranking.values using Table.2 and compare with Table.1 How can I use Sql command having the result when something like : login as user2 so I would get but …
Is there a way for PHP to check if there is a number behind the
Is there a way for PHP to check if there is an number after the . in a variable? for example: $x=4.5 and now i want PHP to check if its a round number or one with a number after the . like shown in $x. I made a script where i want PHP to devide my Variale by 2
Cant access JSON data with PHP
im trying to access the ID and SENT from this JSON but is not working for me. UPDATED Answer Use the php json_decode() function. Like this: 1 is the equivalent for a boolean value of true
Unwanted backslash on parameter while using RewriteRule
URL Examples: This is my htaccess file So I print_r($_REQUEST) on the index.php file to see what I was getting: My problem is that I don’t want the / showing in the last available parameter It would not add the / if I call the examples above like this: What do I need to change on my rules to have
Get current url path
How many examples I have not seen, all are essentially the same, and perform the same thing. Let’s take a look at one of them. Route::current()->uri() We have url https://example.com/test and we …
Laravel variable not getting passed to route
In my page, I have the following anchor: which links to the following function in the controller: and then the blogtitles/edit.blade.php file simply contains: However, in the edit.blade.php, the variable ‘$blogTitle` is empty, even though I know that it isn’t empty in the original page where it is…
how can I print user_Id from this array format?
I am using Laravel 8. I want to fetch single data and use it. Answer Please don’t use print_r to dump your records. kindly use dd() or dump(). So you have a clear idea about collections. So as of now, you fetch as if you have multiple models you can use loops.