Create a datetime by faker laravel with format dd-mm-yyyy minute hour second, for example : 26/01/2022 20:52:23

'from' => $this->faker->dateTime($max = 'now', $timezone = null), 'to' => $this->faker->dateTime($max = 'now', $timezone = null), In my factory file, I use method dateTime for “from” and “to”, but it create with format : yyyy-mm-dd. How can I create value for “from” with format dd-mm-yyyy minute hour second ? Answers: Thank you for visiting the … Read more

Images from PHPFaker got deleted when stored in storage/app/public/news folder

I have two tables news and images. These two tables have one-to-many relationship (one being news). I’m trying to make a factory on images, but right after I migrate with seed, the image saved to news directory but after one second it got deleted, and the path on the database returns news. I’ve read this question but laravel 8.4 (my current laravel project) uses phpfaker, so I guess it’s now deprecated.