diff --git a/.env.example b/.env.example index a2d9bf0..a881a41 100644 --- a/.env.example +++ b/.env.example @@ -8,8 +8,9 @@ # WARNING: This file should not be commited to your application source control as it may contain sensitive data. # --------------------------------------------------------------------------------------------------------------- -# Current environment name +# Current environment name and URL APP_ENV=development +APP_URL=http://localhost # Application debug APP_DEBUG=true diff --git a/app/config/Config.php b/app/config/Config.php index 9b413db..1f4d36d 100644 --- a/app/config/Config.php +++ b/app/config/Config.php @@ -146,6 +146,17 @@ ], + // Queue settings + 'queue' => [ + + // Queue jobs table name + 'table' => 'queue', + + // Max attempts to retry failed jobs + 'max_attempts' => 3 + + ], + // Cache settings 'cache' => [ @@ -193,6 +204,7 @@ 'Model' => \Glowie\Core\Database\Model::class, 'Skeleton' => \Glowie\Core\Database\Skeleton::class, 'Rails' => \Glowie\Core\Http\Rails::class, + 'Queue' => \Glowie\Core\Queue\Queue::class, 'Cache' => \Glowie\Core\Tools\Cache::class, 'Crawler' => \Glowie\Core\Tools\Crawler::class, 'Mailer' => \Glowie\Core\Tools\Mailer::class, @@ -207,7 +219,7 @@ 'other' => [ // Application URL (for CLI route mocking only) - 'url' => 'http://localhost', + 'url' => Env::get('APP_URL', 'http://localhost'), // Default language 'language' => 'en', diff --git a/app/jobs/SendMail.php b/app/jobs/SendMail.php new file mode 100644 index 0000000..8312d15 --- /dev/null +++ b/app/jobs/SendMail.php @@ -0,0 +1,28 @@ +addTo($this->data->email); + $mail->send($this->data->subject, $this->data->message); + } + + } + +?> \ No newline at end of file diff --git a/app/models/Users.php b/app/models/Users.php index 798275c..171221b 100644 --- a/app/models/Users.php +++ b/app/models/Users.php @@ -74,6 +74,12 @@ class Users extends Model{ */ protected $_timestamps = true; + /** + * Timestamp fields date format. + * @var string + */ + protected $_dateFormat = 'Y-m-d H:i:s'; + /** * Use soft deletes in the table. * @var bool diff --git a/composer.json b/composer.json index 285cfa0..d834989 100644 --- a/composer.json +++ b/composer.json @@ -22,12 +22,13 @@ ], "require": { "php": "^7.4|^8.0", - "glowieframework/glowie-core": "^1.5" + "glowieframework/glowie-core": "^1.6" }, "autoload": { "psr-4": { "Glowie\\Commands\\": "app/commands/", "Glowie\\Controllers\\": "app/controllers/", + "Glowie\\Jobs\\": "app/jobs/", "Glowie\\Middlewares\\": "app/middlewares/", "Glowie\\Migrations\\": "app/migrations/", "Glowie\\Models\\": "app/models/",