Skip to content
Advertisement

Tag: laravel

Issue with DocuSign sending Envelopes

I recently changed my DocuSign integration to use the JWT OAuth flow. To achieve this I have a few classes. OAuth Client Signature Client Service Then, in my constructors where I want to use it I’m doing Finally, I use it like so But I get an error that reads DocuSigneSignClientApiException: Error while requesting server, received a non successful HTTP

how to get month name from month-year (08-2022) string in php

how to get month name from month-year (08-2022) string in php i want to get this Aug-2022 (format) from my value 08-2022 I had tried date(‘m-Y’,strtotime(08-2022)) and date(’08-2022′)->format(‘m-Y’) but not working. Answer Just put a “01-” in front of your value to make it a valid date. try self: https://3v4l.org/ZiB70 or with DateTime: Important NOTE: That ! in the format

Laravel migrate ends up in wrong database

I have the following settings in .env When I run Everything seems to be ok. But when I look at my target database “unwa”, it is empty. A die and dump revealed, that I was connected to another database “auction” that happens to be the first (alphabetically) database. I find all my tables in the “auction” database. How can I

How to change Eloquent Builder’s connection?

I have a Eloquent Builder and two database connections(mysql_server1, mysql_server2) as below: Now how can I change the connection of $builder? Any helps would be appreciated Answer Need to get the Query from Eloquent Builder and set a new connection to that and set the new query to the Eloquent Builder as below:

how to simplify this complex query

This is an extract of one of my php functions. I’m struggling to get this optimized as is super slow, as I need to load all interview records, and then check if the current user is either assigned as user_id on the interview record, or if the user->id is in the interviews shared_user_ids which is json I’m also using PostgreSQL

Error while adding Eloquent class to User in Laravel

I want to make an eloquent model out of two table, pekerjaan and user. User hasMany pekerjaan and pekerjaan belongsTo User. How do I add eloquent’s method to the User class in Laravel? I have an error that shows: Cannot declare class AppModelsUser, because the name is already in use Here is my User.php model code: And here is my

variable references & in Laravel

In the following code, I noticed &$list is passed by reference in the loop, however $user and $request are passed by variables. Passing $list directly to the loop won’t change $list outside the loop scope. Why is this? Answer Actually its the core PHP functionality rather than Laravel itself, basically when you are passing variables without reference, it actually clone

Advertisement