Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update config and default view #85

Merged
merged 2 commits into from
Jan 18, 2025
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/Controllers/WelcomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class WelcomeController extends Controller
* Show index
*
* @param Request $request
* @return string
* @return string|null
*/
public function __invoke(Request $request): ?string
{
Expand Down
3 changes: 2 additions & 1 deletion app/Exceptions/ErrorHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class ErrorHandle extends BaseErrorHandler
* handle the error
*
* @param Exception $exception
* @return mixed|string
*/
public function handle($exception)
public function handle(Exception $exception): mixed
{
if (request()->isAjax()) {
return $this->json($exception);
Expand Down
10 changes: 8 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

namespace App\Models;

use Bow\Auth\Authentication as AuthenticatableModel;
use Bow\Auth\Authentication as AuthenticationModel;

class User extends AuthenticatableModel
/**
* @property mixed|string $name
* @property mixed|string $lastname
* @property mixed|string $email
* @property bool|mixed|string $password
*/
class User extends AuthenticationModel
{
/**
* The list of hidden field when toJson is called
Expand Down
4 changes: 2 additions & 2 deletions app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(User $user)
/**
* Get all available users
*
* @return Collection
* @return Collection|null
*/
public function fetchAll(): ?Collection
{
Expand All @@ -38,7 +38,7 @@ public function fetchAll(): ?Collection
* @param string $name
* @param string $lastname
* @param string $email
* @return User
* @return User|null
*/
public function create(string $name, string $lastname, string $email): ?User
{
Expand Down
2 changes: 1 addition & 1 deletion bow
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use Bow\Console\Console;

// Register The Auto Loader
if (!file_exists(__DIR__."/vendor/autoload.php")) {
die("Please install the depencencies with 'composer update'");
die("Please install the dependencies with 'composer update'");
}

require __DIR__."/vendor/autoload.php";
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
},
"require": {
"php": "^8.1",
"bowphp/framework": "^5.0",
"bowphp/policier": "^3.0"
"bowphp/framework": "^5.x-dev",
"bowphp/policier": "^3.0",
"ext-pdo": "*",
"ext-redis": "*",
"ext-curl": "*",
"ext-ftp": "*"
},
"require-dev": {
"phpunit/phpunit": "^9",
Expand Down
4 changes: 2 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
'name' => app_env('APP_NAME', 'Bow Application'),

/**
* The auto csrf enable csrf protected automaticly
* The auto csrf enable csrf protected automatically
* on POST, DELETE, PUT
*/
"auto_csrf" => app_env("APP_AUTO_CSRF", true),
"auto_csrf" => (bool) app_env("APP_AUTO_CSRF", true),

/**
* Root of the application
Expand Down
6 changes: 4 additions & 2 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@
// The filesystem connection
"file" => [
"driver" => "file",
"path" => __DIR__ . '/../var/cache'
"path" => __DIR__ . '/../var/cache',
"prefix" => "",
],

// The database connection
"database" => [
"driver" => "database",
"connection" => app_env('DB_DEFAULT', 'mysql'),
"table" => "caches",
"prefix" => "",
],

// The redis connection
"redis" => [
'driver' => 'redis',
'database' => app_env('REDIS_CACHE_DB', 5),
"prefix" => "__app__",
"prefix" => "",
]
]
];
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* The database on which the default application will connect.
*
* The database by default, it is on this data base that will connects
* The database by default, it is on this database that will connect
* automatically. So you absolutely must not edit the default key.
*
* In the opposite box you must execute the code in each route.
Expand Down
17 changes: 9 additions & 8 deletions config/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

if (!function_exists('mix')) {
/**
* Get mixfile chunkhash version
* Get mix file chunk hash version
*
* @param string $path
* @return string
* @throws Exception
*/
function mix($path)
function mix(string $path)
{
$manifest = config('app.mixfile_path');

Expand All @@ -34,7 +35,7 @@ function mix($path)
* @param string $path
* @return string
*/
function public_path($path = '')
function public_path(string $path = ''): string
{
return __DIR__ . '/../public/' . ltrim($path, '/');
}
Expand All @@ -47,7 +48,7 @@ function public_path($path = '')
* @param string $path
* @return string
*/
function frontend_path($path = '')
function frontend_path(string $path = '')
{
return __DIR__ . '/../frontend/' . ltrim($path, '/');
}
Expand All @@ -60,7 +61,7 @@ function frontend_path($path = '')
* @param string $path
* @return string
*/
function storage_path($path = '')
function storage_path(string $path = '')
{
return __DIR__ . '/../var/' . ltrim($path, '/');
}
Expand All @@ -72,7 +73,7 @@ function storage_path($path = '')
*
* @return string
*/
function base_path($path = '')
function base_path($path = ''): string
{
return rtrim(rtrim(realpath(__DIR__ . '/..'), '/') . '/' . $path, '/');
}
Expand All @@ -86,7 +87,7 @@ function base_path($path = '')
* @param int $len
* @return string
*/
function gen_slix($len = 4)
function gen_slix(int $len = 4): string
{
return substr(str_shuffle(uniqid()), 0, $len);
}
Expand All @@ -98,7 +99,7 @@ function gen_slix($len = 4)
*
* @return string
*/
function gen_unique_id()
function gen_unique_id(): string
{
$id = base_convert(microtime(false), 10, 36);

Expand Down
4 changes: 2 additions & 2 deletions config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"from" => "[email protected]",

/**
* SMTP authentification
* SMTP authentication
*/
"smtp" => [
"hostname" => app_env("SMTP_HOSTNAME"),
Expand All @@ -33,7 +33,7 @@
],

/**
* SMTP authentification
* SMTP authentication
*/
"ses" => [
"profile" => app_env("SES_PROFILE", "default"),
Expand Down
2 changes: 1 addition & 1 deletion config/policier.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

return [
"signkey" => app_env("APP_JWT_SECRET", "FivwuTmpJlwfXB/WMjAyMS0wMS0yNCAyMDozMTozMTE2MTE1MjAyOTEuMDEwOA=="),
"signkey" => app_env("APP_JWT_SECRET"),

/**
* Token expiration time
Expand Down
4 changes: 2 additions & 2 deletions config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

return [
/**
* The defaut connexion
* The default connexion
*/
"default" => "beanstalkd",
"default" => "sync",

/**
* The queue drive connection
Expand Down
2 changes: 1 addition & 1 deletion config/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],

/**
* When using token. This is the life time of a token.
* When using token. This is the lifetime of a token.
* It is strongly advised to program with tokens.
*/
'token_expirate_time' => 50000
Expand Down
3 changes: 0 additions & 3 deletions config/storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
'password' => app_env('FTP_PASSWORD'),
'username' => app_env('FTP_USERNAME'),
'port' => app_env('FTP_PORT', 21),
// The basic folder of the server
'root' => app_env('FTP_STARTROOT', null),
// A `true` to activate a secure connection.
'tls' => app_env('FTP_TLS', false),
// Connection waiting time
'timeout' => app_env('FTP_TIMEOUT', 50)
],

Expand Down
6 changes: 3 additions & 3 deletions config/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
/**
* The views directory. It is in this repertory that you will put all your views.
* The views must have the instantion you have defined in 'template_extension'
* The views must have the installation you have defined in 'template_extension'
* if no error will be launched
*/
'path' => __DIR__ . '/../templates',
Expand All @@ -17,7 +17,7 @@
* Template supported twig, php, tintin
* Define the template name.
* Example: define twig with package twig/twig for define twig template
* Bow Framework support actualy twig, tintin, php
* Bow Framework support actually twig, tintin, php
*/
'engine' => 'tintin',

Expand All @@ -36,7 +36,7 @@
/**
* Additional option
*/
'aditionnal_options' => [
'additional_options' => [
// 'auto_reload_cache' => true
]
];
19 changes: 8 additions & 11 deletions frontend/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* import Vue from "vue"
* import Example from "./Example.vue"
*/
// import Vue from "vue"
// import Example from "./Example.vue"

window.axios = require('axios');

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
Expand All @@ -16,10 +15,8 @@ if (token) {
*/
require('./Example.jsx');

/*
* Vue.component('example', Example);
*
* new Vue({
* el: "#main"
* });
*/
// Vue.component('example', Example);

// new Vue({
// el: "#main"
// });
18 changes: 9 additions & 9 deletions frontend/sass/app.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import "variables";
#main {
position: relative;
margin: 10% auto;
width: 550px;
text-align: center;
font-family: $font-family;
}
@use "variables";

#main {
position: relative;
margin: 10% auto;
width: 550px;
text-align: center;
font-family: $font-family;
}
57 changes: 27 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
{
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"format": "composer run-script lint"
},
"dependencies": {
"axios": ">=0.21.1",
"babel-loader": "^8.0.4",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"css-loader": "^2.0.2",
"jquery": "^3.2",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.5",
"popper.js": "^1.12",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"resolve-url-loader": "^5.0.0",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"vue": "^2.5.17"
},
"devDependencies": {
"@babel/preset-react": "^7.0.0",
"vue-template-compiler": "^2.5.21"
}
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.7.9",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.17.0",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.17.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.16",
"globals": "^15.14.0",
"typescript": "~5.6.2",
"typescript-eslint": "^8.18.2",
"vite": "^6.0.5"
}
}
Binary file added public/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/img/logo.svg

This file was deleted.

Loading
Loading