Anybody ised sofort for laravel payment integration?

|
hypernxf 2020-12-22 12:02:55
This way your model will automatically store the remainingTime as a new attributes whenever it’s returned from JSON
rootkings 2020-12-22 12:05:46
hypernxf 2020-12-22 12:02:32
The second way is to use $append to append attributes to JSON values.
https://laravel.com/docs/8.x/eloquent-serialization#appending-values-to-json

I know this way thanks but my question is in my table i have a string type date. I want to convert to time and calculatin to remaining time and this remainin time added json.

hypernxf 2020-12-22 12:06:04
ok
hypernxf 2020-12-22 12:06:45
what is the name of your datetime column in your db?
rootkings 2020-12-22 12:07:32
hypernxf 2020-12-22 12:06:45
what is the name of your datetime column in your db?

effectiveDate

rootkings 2020-12-22 12:07:54
This is string value in db like this: 25.12.2020 18:00:00
hypernxf 2020-12-22 12:08:05
within your Notification model, include in $dates
hypernxf 2020-12-22 12:08:24
oh custom format. In that case need to define the format ony our own
hypernxf 2020-12-22 12:09:00
https://laravel.com/docs/8.x/eloquent-mutators#date-casting
rootkings 2020-12-22 12:09:18
Actually i want to show in json file remaining time attribute like this (1 day ,3 hour bla bla)
hypernxf 2020-12-22 12:09:42
It’s a two step procedure.
hypernxf 2020-12-22 12:10:48
Step 1) allow model to define effective_date as a Carbon instance
Step 2) Calculate time difference using Carbon
Step 3) Insert the time difference in a function and use $append to append into Model
hypernxf 2020-12-22 12:11:00
3 steps. my bad
hypernxf 2020-12-22 12:15:02
So your entire code I think will look like this….

public $dates = [‘effective_date’ => ‘datetime:format it yourself”];

public $appends = [‘time_remaining’];

public function getTimeRemainingAttributes()
{
// use carbon to do your difference in time calculation
return ‘1 day 2 hours 5 mins’;
}

// In your Controller. $notification->time_remaining will be automatically included in your toJson().

hypernxf 2020-12-22 12:15:13
Good luck.
rootkings 2020-12-22 12:16:29
Thanks Jason, i will try and i’ll let you know if i do that 🙂
hypernxf 2020-12-22 12:39:32
No prob!
kevinpita 2020-12-22 12:42:33
Does livewire replace the use of controllers?
hypernxf 2020-12-22 12:53:39
yes and no
hypernxf 2020-12-22 12:54:02
Personally for me, most of the time the answer is yes
hypernxf 2020-12-22 12:55:11
I use Controller when a certain endpoint dont always redirect to a livewire page.
kevinpita 2020-12-22 12:55:30
Ok, thanks!!
hypernxf 2020-12-22 12:55:31
But it’s getting rarer nowadays. Unless i’m just creating api routes.
praneet81 2020-12-22 12:58:01
laravel_discuss-63616.jpg
Photo from Praneet Singh Roopra
praneet81 2020-12-22 12:58:35
laravel_discuss-63617.jpg
Photo from Praneet Singh Roopra
praneet81 2020-12-22 12:59:24
How do i force SSL in my laravel application? I’ve put this on my .htaccess still it doesn’t force it.. can anyone help me out with a working htaccess code?
Jomitz 2020-12-22 14:44:34
Anybody ised sofort for laravel payment integration?
Jomitz 2020-12-22 14:44:46
*used
rootkings 2020-12-22 15:18:58
Does anyone used Breeze?
2020-12-22 15:19:36
Jomitz 2020-12-22 14:44:34
Anybody ised sofort for laravel payment integration?

Plz eloborate not able to understand

o_sayfullayev 2020-12-22 15:24:34
2020-12-22 15:19:36
Plz eloborate not able to understand

according to my understanding, “Anybody used sofort for laravel payment integration?”

amirali_besharati 2020-12-22 19:15:43
Greetings friends
Good time
Please help if possible
Website launched with Laravel
What strengths and weaknesses can it have?
Respectfully yours
SHOSHO_RAM 2020-12-22 19:31:25
I’m looking for new oppourtinty in Jeddah (KSA)
with 14 years of experience
rootkings 2020-12-22 20:22:20
Hi friends, I’m doing a transaction in Laravel. I have a table called Notifications, like this: http://prntscr.com/w7yzkz (I keep the effectiveDate part as a string). I calculate how long the version is here by deducting the time with Carbon. My model file looks like this: https://codeshare.io/5Q3m3J. My controller page looks like this: https://codeshare.io/G60A0Q. I return the transformation, the remaining_time part I added in the first return data does the correct calculation, but in the second return data it gets its value. Here’s how: http://prntscr.com/w7z1qm. There is a mistake I made but I could not find where I hope I could explain.

ScreenshotLightshot
Captured with Lightshot
Bhuvi100 2020-12-22 22:11:39
rootkings 2020-12-22 20:22:20
Hi friends, I’m doing a transaction in Laravel. I have a table called Notifications, like this: http://prntscr.com/w7yzkz (I keep the effectiveDate part as a string). I calculate how long the version is here by deducting the time with Carbon. My model file looks like this: https://codeshare.io/5Q3m3J. My controller page looks like this: https://codeshare.io/G60A0Q. I return the transformation, the remaining_time part I added in the first return data does the correct calculation, but in the second return data it gets its value. Here’s how: http://prntscr.com/w7z1qm. There is a mistake I made but I could not find where I hope I could explain.

Why you are using foreach(Notification::all()) in remaining time accessor method in Notification model?

|