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
10 changes: 5 additions & 5 deletions app/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Bow\Database\Database;
use Bow\Validation\Validate;
use Bow\Validation\Validator;
use Bow\Queue\ProducerService;
use Bow\Queue\QueueJob;
use Bow\Contracts\ResponseInterface;
use Bow\Configuration\Loader as Config;
use Bow\Database\QueryBuilder;
Expand All @@ -17,12 +17,12 @@ class Controller
/**
* Push the producer on queue list
*
* @param ProducerService $producer
* @param QueueJob $job
* @return mixed
*/
public function queue(ProducerService $producer)
public function queue(QueueJob $job)
{
queue($producer);
queue($job);
}

/**
Expand Down Expand Up @@ -93,7 +93,7 @@ public function config(?string $key = null, mixed $setting = null)
* @param ?callable $cb
* @return Database
*/
public function db(?string $name = null, ?callable $cb = null)
public function app_db(?string $name = null, ?callable $cb = null)
{
return call_user_func_array('db', func_get_args());
}
Expand Down
19 changes: 18 additions & 1 deletion app/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App;

use Bow\Router\Router;
use Bow\Configuration\Loader as ApplicationLoader;

class Kernel extends ApplicationLoader
Expand Down Expand Up @@ -36,7 +37,7 @@ public function namespaces(): array
'event' => 'App\\Events',
'listener' => 'App\\Listeners',
'exception' => 'App\\Exceptions',
'producer' => 'App\\Producers',
'job' => 'App\\Jobs',
'command' => 'App\\Commands',
'messaging' => 'App\\Messages',
];
Expand Down Expand Up @@ -102,6 +103,22 @@ public function boot(): ApplicationLoader
{
parent::boot();

$this->routes();

return $this;
}

/**
* Load the define route
*
* @return void
*/
public function routes(): void
{
global $router;

$router = Router::getInstance();

require_once base_path('routes/app.php');
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions bow
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ $setting->setServiceDirectory(__DIR__.'/app/Services');
$setting->setEventDirectory(__DIR__.'/app/Events');
$setting->setEventListenerDirectory(__DIR__.'/app/Listeners');
$setting->setSeederDirectory(__DIR__.'/seeders');
$setting->setComponentDirectory(__DIR__.'/frontend');
$setting->setComponentDirectory(__DIR__.'/assets');
$setting->setConfigDirectory(__DIR__.'/config');
$setting->setPublicDirectory(__DIR__.'/public');
$setting->setProducerDirectory(__DIR__.'/app/Producers');
$setting->setJobDirectory(__DIR__.'/app/Jobs');
$setting->setCommandDirectory(__DIR__.'/app/Commands');
$setting->setMessagingDirectory(__DIR__.'/app/Messages');

Expand All @@ -50,7 +50,7 @@ $console->bind($kernel);

// Load the custom command application
if (file_exists(__DIR__.'/routes/console.php')) {
require __DIR__.'/routes/console.php';
require_once __DIR__.'/routes/console.php';
}

// Start console
Expand Down
4 changes: 2 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
'env_file' => realpath(__DIR__ . '/../.env.json'),

/**
* Path to the frontend folder
* Path to the assets folder
*/
'frontend_path' => dirname(__DIR__) . '/frontend',
'frontend_path' => dirname(__DIR__) . '/assets',

/**
* Path to the seeders folder
Expand Down
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* automatically. So you absolutely must not edit the default key.
*
* In the opposite box you must execute the code in each route.
* `db('the key name')` or `Bow\Database\Database::connection('the key name')`
* `app_db('the key name')` or `Bow\Database\Database::connection('the key name')`
*/
'connections' => [
/**
Expand Down
8 changes: 6 additions & 2 deletions config/storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,20 @@

/**
* S3 configuration
* Supports both AWS S3 and MinIO (S3-compatible storage)
*/
's3' => [
'driver' => 's3',
'bucket' => app_env('S3_BUCKET', 'settlements'),
'region' => app_env('AWS_REGION'),
'region' => app_env('AWS_REGION', 'us-east-1'),
'version' => 'latest',
'credentials' => [
'key' => app_env('AWS_KEY'),
'secret' => app_env('AWS_SECRET'),
],
]
// MinIO configuration (optional)
'endpoint' => app_env('AWS_ENDPOINT'), // e.g., 'http://localhost:9000' for MinIO
'use_path_style_endpoint' => app_env('AWS_USE_PATH_STYLE_ENDPOINT', false), // Set to true for MinIO
],
],
];
7 changes: 2 additions & 5 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@

// Bind kernel to application
$app->bind(
Kernel::configure(realpath(__DIR__ . '/../config'))
Kernel::configure(base_path('config'))
);

// Load application routing
require __DIR__ . "/../routes/app.php";

// Run The Application
$app->send();
$app->run();
2 changes: 1 addition & 1 deletion routes/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

use App\Controllers\WelcomeController;

$app->get('/', WelcomeController::class)->name('app.index');
$router->get('/', WelcomeController::class)->name('app.index');
13 changes: 7 additions & 6 deletions routes/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

use Bow\Console\Color;
use Bow\Console\Argument;
use App\Commands\TestCommand;

$console->addCommand(
'hello',
function (Argument $argument) {
echo Color::green("hello, bow task runner.");
}
);
$console->addCommand('hello', function (Argument $argument) {
$index = route('app.index');
echo Color::green("hello, bow task runner.");
});

$console->addCommand('test:hello', TestCommand::class);
25 changes: 25 additions & 0 deletions seeders/20251220174703-user-seeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

use App\Models\User;
use Faker\Factory as FakerFactory;

class UserSeeder20251220174703
{
public function run()
{
$faker = FakerFactory::create();

foreach (range(1, 5) as $value) {
$user =[
'name' => $faker->name,
'description' => $faker->text(100),
'email' => $faker->email,
'password' => app_hash('password'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
];

User::create($user);
}
}
}
7 changes: 0 additions & 7 deletions seeders/_database.php

This file was deleted.

27 changes: 0 additions & 27 deletions seeders/users.php

This file was deleted.

6 changes: 3 additions & 3 deletions templates/layouts/default.tintin.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
</style>
</head>
<body>
<main id="main">
%inject('content')
</main>
<main id="main">
%inject('content')
</main>
</body>
</html>
10 changes: 5 additions & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
plugins: [react(), vue(), tailwindcss()],
root: path.resolve(__dirname, 'frontend'),
root: path.resolve(__dirname, 'assets'),
build: {
outDir: path.resolve(__dirname, 'public'),
emptyOutDir: true,
rollupOptions: {
input: {
app: path.resolve(__dirname, 'frontend/js/app.js')
app: path.resolve(__dirname, 'assets/js/app.js')
},
output: {
entryFileNames: 'js/[name].js',
Expand All @@ -31,7 +31,7 @@ export default defineConfig({
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "${path.resolve(__dirname, 'frontend/sass/variables.scss')}";`
additionalData: `@import "${path.resolve(__dirname, 'assets/sass/variables.scss')}";`
},
less: {
javascriptEnabled: true
Expand All @@ -40,8 +40,8 @@ export default defineConfig({
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'frontend/js'),
'@sass': path.resolve(__dirname, 'frontend/sass')
'@': path.resolve(__dirname, 'assets/js'),
'@sass': path.resolve(__dirname, 'assets/sass')
}
},
server: {
Expand Down
Loading