Posts

Showing posts from October, 2023

How do I make doctrine support timestamp columns

Problem:  [Doctrine\DBAL\DBALException]   Unknown column type "timestamp" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DB   AL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrine   TypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information. Solution: For everyone who is still coming across this issue via Google or something, there currently is an official way to support this. See this part of the docs. Basically, you need to add the following to your config/database.php file: 'dbal' => [     'types' => [         'timestamp' => Times...

[6.0] Where is the command app:name?

Problem The app:name command, no longer available in laravel 6.0, there is some way to change the namespaces, as was being done with that command in all the necessary files. Solution  Go to the following link and follow the steps  (If link not working), code is present in below. https://gist.github.com/isluewell/b824c0aef32f5007170fcd0d8498b657 First we create the command with php artisan make:command AppName Then we replace the content created in the file app/Console/Commands/AppName.php with the content of the gist. and then use it in the usual way, changing "something" for the name of your application. php artisan app:name <something>  replace something with your required name ... <?php namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Support\Composer; use Symfony\Component\Finder\Finder; use Illuminate\Filesystem\Filesystem; use Symfony\Component\Console\Input\InputArgument; class AppName extends Command { /** * The con...