Skip to content

Commit

Permalink
1.6 setup
Browse files Browse the repository at this point in the history
  • Loading branch information
eugabrielsilva committed May 25, 2024
1 parent 27d683e commit 0ba4f85
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion app/config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [

Expand Down Expand Up @@ -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,
Expand All @@ -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',
Expand Down
28 changes: 28 additions & 0 deletions app/jobs/SendMail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
namespace Glowie\Jobs;

use Glowie\Core\Queue\Job;
use Glowie\Core\Tools\Mailer;

/**
* Send mail job for Glowie application.
* @category Queue
* @package glowieframework/glowie
* @author Glowie
* @copyright Copyright (c) Glowie
* @license MIT
*/
class SendMail extends Job{

/**
* Runs the job.
*/
public function run(){
$mail = new Mailer();
$mail->addTo($this->data->email);
$mail->send($this->data->subject, $this->data->message);
}

}

?>
6 changes: 6 additions & 0 deletions app/models/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down

0 comments on commit 0ba4f85

Please sign in to comment.