Thanks to visit codestin.com
Credit goes to github.com

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
2 changes: 1 addition & 1 deletion app/Configurations/ApplicationConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ApplicationConfiguration extends Configuration
/**
* Launch configuration
*
* @param Loader $config
* @param Loader $config
* @return void
*/
public function create(Loader $config): void
Expand Down
22 changes: 11 additions & 11 deletions app/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public function config(?string $key = null, mixed $setting = null)
/**
* Get Database Instance
*
* @param ?string $name
* @param ?callable $cb
* @param ?string $name
* @param ?callable $cb
* @return Database
*/
public function db(?string $name = null, ?callable $cb = null)
Expand All @@ -101,8 +101,8 @@ public function db(?string $name = null, ?callable $cb = null)
/**
* Alias of table
*
* @param $name
* @param string $connexion
* @param $name
* @param string $connexion
* @return QueryBuilder
*/
public function table(string $name, ?string $connexion = null): QueryBuilder
Expand Down Expand Up @@ -133,8 +133,8 @@ public function getToken(): string
/**
* Make validation
*
* @param Request $request
* @param array $rule
* @param Request $request
* @param array $rule
* @return Validate
*/
protected function validate(Request $request, array $rule): Validate
Expand All @@ -147,10 +147,10 @@ protected function validate(Request $request, array $rule): Validate
/**
* Format API response
*
* @param string $message
* @param string $code
* @param array $data
* @param int $status
* @param string $message
* @param string $code
* @param array $data
* @param int $status
* @return array
*/
public function nativeApiErrorResponse(
Expand All @@ -170,7 +170,7 @@ public function nativeApiErrorResponse(
/**
* Fire Event
*
* @param string $event
* @param string $event
* @return void
*/
public function emit($event)
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/WelcomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class WelcomeController extends Controller
/**
* Show index
*
* @param Request $request
* @param Request $request
* @return string|null
*/
public function __invoke(Request $request): ?string
Expand Down
18 changes: 12 additions & 6 deletions app/Exceptions/ErrorHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ErrorHandle extends BaseErrorHandler
/**
* handle the error
*
* @param Exception $exception
* @param Exception $exception
* @return mixed|string
*/
public function handle(Exception $exception): mixed
Expand All @@ -22,20 +22,26 @@ public function handle(Exception $exception): mixed
}

if (
$exception instanceof ModelNotFoundException
$exception instanceof ModelNotFoundException
|| $exception instanceof HttpException
) {
$code = $exception->getStatusCode();

return $this->render('errors.' . $code, [
return $this->render(
'errors.' . $code,
[
'code' => 404,
'exception' => $exception
]);
]
);
}

return $this->render('errors.500', [
return $this->render(
'errors.500',
[
'code' => 404,
'exception' => $exception
]);
]
);
}
}
1 change: 1 addition & 0 deletions app/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function namespaces(): array
'exception' => 'App\\Exceptions',
'producer' => 'App\\Producers',
'command' => 'App\\Commands',
'messaging' => 'App\\Messaging',
];
}

Expand Down
4 changes: 2 additions & 2 deletions app/Middlewares/GuestMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class GuestMiddleware implements BaseMiddleware
/**
* Launch function of the middleware.
*
* @param Request $request
* @param Request $request
* @param callable $next
* @param array $args
* @param array $args
* @return mixed
*/
public function process(Request $request, callable $next, array $args = []): mixed
Expand Down
6 changes: 3 additions & 3 deletions app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public function fetchAll(): ?Collection
/**
* Create new user
*
* @param string $name
* @param string $lastname
* @param string $email
* @param string $name
* @param string $lastname
* @param string $email
* @return User|null
*/
public function create(string $name, string $lastname, string $email): ?User
Expand Down
10 changes: 5 additions & 5 deletions config/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Get mix file chunk hash version
*
* @param string $path
* @param string $path
* @return string
* @throws Exception
*/
Expand Down Expand Up @@ -32,7 +32,7 @@ function mix(string $path)
/**
* Get public directory
*
* @param string $path
* @param string $path
* @return string
*/
function public_path(string $path = ''): string
Expand All @@ -45,7 +45,7 @@ function public_path(string $path = ''): string
/**
* Get frontend directory
*
* @param string $path
* @param string $path
* @return string
*/
function frontend_path(string $path = '')
Expand All @@ -58,7 +58,7 @@ function frontend_path(string $path = '')
/**
* Get storages directory
*
* @param string $path
* @param string $path
* @return string
*/
function storage_path(string $path = '')
Expand All @@ -84,7 +84,7 @@ function base_path($path = ''): string
* Generate a random code.
* Can be used to hide the name of form fields.
*
* @param int $len
* @param int $len
* @return string
*/
function gen_slix(int $len = 4): string
Expand Down
21 changes: 12 additions & 9 deletions migrations/Version20170407084225CreateUsersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ class Version20170407084225CreateUsersTable extends Migration
*/
public function up(): void
{
$this->create("users", function (SQLGenerator $table) {
$table->addIncrement('id');
$table->addString('name');
$table->addString('email', ['unique' => true]);
$table->addString('description', ['nullable' => true]);
$table->addString('password');
$table->addTimestamps();
$table->withEngine('InnoDB');
});
$this->create(
"users",
function (SQLGenerator $table) {
$table->addIncrement('id');
$table->addString('name');
$table->addString('email', ['unique' => true]);
$table->addString('description', ['nullable' => true]);
$table->addString('password');
$table->addTimestamps();
$table->withEngine('InnoDB');
}
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://raw.githubusercontent.com/bowphp/arts/master/bow.jpg" width="100">
<img src="https://raw.githubusercontent.com/bowphp/arts/master/bow.png" width="50">

## Bow Framework

Expand Down
9 changes: 6 additions & 3 deletions routes/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
use Bow\Console\Color;
use Bow\Console\Argument;

$console->addCommand('hello', function (Argument $argument) {
echo Color::green("hello, bow task runner.");
});
$console->addCommand(
'hello',
function (Argument $argument) {
echo Color::green("hello, bow task runner.");
}
);
2 changes: 1 addition & 1 deletion seeders/_database.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$users = require __DIR__ . "/users.php";
$users = include __DIR__ . "/users.php";

$seeders = array_merge($users);

Expand Down
1 change: 1 addition & 0 deletions seeders/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @see https://fakerphp.github.io for all documentation
*/

$faker = Factory::create();

$seeds = [];
Expand Down
Loading