Follow this documentation: https://flatpickr.js.org/formatting/
You probably want something like Y-m-d H:i:S
, adapt as needed.
Do NOT use m
for minutes, it's for months.
Follow this documentation: https://flatpickr.js.org/formatting/
You probably want something like Y-m-d H:i:S
, adapt as needed.
Do NOT use m
for minutes, it's for months.
src/Service/SessionTokenService.php
<?php
namespace App\Service;
use App\Helper\RandomDataGeneratorHelper;
use Exception;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
Note: The file's absolute path is NOT stored in database to prevent directory traversal in case an attacker manages to modify said path through SQL injection.
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore
is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules
directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
.gitignore
in your home directory and add any filepath patterns you want to ignore.Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignore
for.gitignore
in your home directory, if you prefer.
Following example demonstrates how to:
See https://symfony.com/doc/4.4/components/http_foundation.html#serving-files
Host these files in a directory outside of /public
, so they can be accessed only through the controller and its @Security()
authorization. For example you could create a /private-uploads
directory at the root of your project.
You must do this at the database level, not at the PHP/ORM level or it could result in a race condition.
src/Repository/ExampleRepository.php:
<?php