Skip to content
Advertisement

Tag: laravel

Laravel – query to join tables in Many to many relation

I have the below tables posts – id – name categories – id – name category_post – post_id – category_id Post.php Category.php A post may contain many categories. I want to query all posts related to the categories of any given post in the least number of database queries. For example, If a post belongs to three categories, I want

Change login system by API in Laravel 8

I make my first app with API. I am beginner in Laravel and php. I have this migration: and this is my AuthController: Login work’s fine. In addition to the login and password, I need to verify the status column. If status = 1 – then login is possible. How can I do this? Please help me 🙂 How can

How to integrate React App With Laravel Sanctum on Apache2

I use React App on localhost:3000 For Laravel API I use apache2 from Laradock and site is: site.localhost To authorize users I use Sanctum Problem is I can not get cookies from sanctum/csrf-cookie (i got them in response header but they are not appear in cookies) and then got 419 code when i try to login via API My .env

Laravel yajrabox relation sort

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 kabupaten.id but when I try to sort column, it

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 Thanks for your reply. The culprit is my PHP version

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 passed from. Any idea at all what is going wrong? I have

Advertisement