Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/Http/Controllers/BillEventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Http\Controllers;

use App\Models\Bill;
use DateInterval;
use DateTime;
use Illuminate\Support\Facades\Request;

class BillEventController
Expand All @@ -20,7 +22,7 @@ public function __invoke()
'url' => route('bills.show', $bill->id),
'paid' => $bill->paid,
'start' => $date,
'end' => $date,
'end' => (new DateTime($date))->add(new DateInterval('P1D'))->format('Y-m-d'),
];
}
});
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Account extends Model
];

protected $casts = [
'date_opened' => 'datetime',
'date_opened' => 'datetime:Y-m-d H:i:s',
];

public function getRunningBalanceAttribute()
Expand All @@ -39,6 +39,6 @@ public function getRunningBalanceAttribute()

public function transactions()
{
return $this->hasMany(Transaction::class);
return $this->hasMany(Transaction::class)->ordered();
}
}
4 changes: 2 additions & 2 deletions app/Models/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class Bill extends Model
];

protected $casts = [
'start_date' => 'date',
'start_date' => 'date:Y-m-d',
];

public function transactions()
{
return $this->hasMany(Transaction::class);
return $this->hasMany(Transaction::class)->ordered();
}

public function getTotalAttribute()
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public function getProgressAttribute()

public function transactions()
{
return $this->hasMany(Transaction::class);
return $this->hasMany(Transaction::class)->ordered();
}
}
2 changes: 1 addition & 1 deletion app/Models/Goal.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Goal extends Model
protected $casts = [
'amount' => 'float',
'balance' => 'float',
'goal_date' => 'date',
'goal_date' => 'date:Y-m-d',
];

public function getAchievedAttribute(): bool
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Transaction extends Model
];

protected $casts = [
'date' => 'datetime',
'date' => 'datetime:Y-m-d H:i:s',
'amount' => 'float',
'cleared' => 'bool',
'inflow' => 'bool',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public function goals()

public function transactions()
{
return $this->hasMany(Transaction::class);
return $this->hasMany(Transaction::class)->ordered();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public function up()
$table->integer('month');
$table->bigInteger('category_id')->unsigned()->nullable();
$table->bigInteger('user_id')->unsigned()->nullable();
$table->decimal('budgeted', 12, 3);
$table->decimal('spent', 12, 3);
$table->decimal('balance', 12, 3);
$table->decimal('budgeted', 12, 3)->default(0);
$table->decimal('spent', 12, 3)->default(0);
$table->decimal('balance', 12, 3)->default(0);
$table->timestamps();

$table->foreign('category_id')
Expand Down
112 changes: 58 additions & 54 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,62 @@
# For more information: https://laravel.com/docs/sail
services:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.4
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.4/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
- selenium
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
MYSQL_EXTRA_OPTIONS: '${MYSQL_EXTRA_OPTIONS}'
volumes:
- 'sail-mysql:/var/lib/mysql'
networks:
- sail
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
retries: 3
timeout: 5s
selenium:
image: 'selenium/standalone-chrome'
volumes:
- '/dev/shm:/dev/shm'
networks:
- sail
laravel:
build:
context: ./vendor/laravel/sail/runtimes/8.4
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.4/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
- selenium
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
MYSQL_EXTRA_OPTIONS: '${MYSQL_EXTRA_OPTIONS}'
volumes:
- 'sail-mysql:/var/lib/mysql'
# - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
networks:
- sail
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-p${DB_PASSWORD}']
retries: 3
timeout: 5s
selenium:
image: 'selenium/standalone-chromium'
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- '/dev/shm:/dev/shm'
networks:
- sail
networks:
sail:
driver: bridge
sail:
driver: bridge
volumes:
sail-mysql:
driver: local
sail-mysql:
driver: local
Loading