Skip to content
Advertisement

How to save data?

My data is like this After re-saving the data is saved two double. public function store(Request $request) { foreach ($request->name as $key => $name) { Setting::firstOrCreate( …

Fetching A Patron Data From Patreon API

I’m developing a webpage with Laravel 8 and I have issues with fetching a patron details by id from Patreon API. Here is my use case. I’ve added “Login with Patreon” option to my webpage, and it works well. When someone login with Patreon successfully, I store her/his Patreon id and set remember token to login the member automatically when

Using multi where queries Laravel relationships

I have two tables (Table1, Table2). I want to print the sum of the records whose properties match Table1 in Table2 while listing the Table1 table. My two tables contain very large records, performance is important to me. I’m adding the sample database pictures: Thank you. Answer First, add below use statement to the top of your controller: Now, If

Laravel online status

I have made custom middleware to track user online status but it has an issue, I can see my own online status but I always see other users as offline while they are not. Code Middleware class …

Contact Form, sending an email is just downloading my PHP file

I’m having a weird error that I cannot figure out with a PHP file, I’ve never touched PHP and I am trying to use it to send a Name, Email Address, and a message back to me from a website, but for some reason, the code I wrote is just downloading the PHP file instead, can anyone else see where

Google Classroom – Create Course Error PHP

I’m trying to create a course using the Google_Service_Classroom API, using PHP, but I get an error in the call. My return: I’m seeing the documents, but I don’t see where to fix this problem. Answer The error message is self-explanatory. It says Argument 1 passed to Google_Service_Classroom_Resource_Courses::create() must be an instance of Google_Service_Classroom_Course, array given and this occurs because

How can I get an array from an If statement?

I’m trying to detect conditions of a string length within input fields. I need to know which condition(s) is met from the if statement and then put that/those in an array to display. Here’s my code: …

Advertisement