parent
262d37d862
commit
2abd83526d
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@ -1,4 +1,5 @@
|
||||
version: 2
|
||||
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
@ -9,6 +10,7 @@ updates:
|
||||
prefix: "#5 - (php) "
|
||||
target-branch: main
|
||||
open-pull-requests-limit: 1
|
||||
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
1
.github/workflows/check-pr-title.yml
vendored
1
.github/workflows/check-pr-title.yml
vendored
@ -12,5 +12,6 @@ jobs:
|
||||
check-pr-title:
|
||||
name: Check PR title
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: blumilksoftware/action-pr-title@v1.2.0
|
||||
|
1
.github/workflows/test-and-lint-js.yml
vendored
1
.github/workflows/test-and-lint-js.yml
vendored
@ -6,6 +6,7 @@ on:
|
||||
|
||||
jobs:
|
||||
test-and-lint-js:
|
||||
name: Test & lint JS stuff
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
|
1
.github/workflows/test-and-lint-php.yml
vendored
1
.github/workflows/test-and-lint-php.yml
vendored
@ -8,6 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
test-and-lint-php:
|
||||
name: Test & lint PHP stuff
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
|
@ -7,11 +7,9 @@ namespace Toby\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens;
|
||||
use HasFactory;
|
||||
use Notifiable;
|
||||
|
||||
|
@ -2,23 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$app = new Illuminate\Foundation\Application(
|
||||
$_ENV["APP_BASE_PATH"] ?? dirname(__DIR__),
|
||||
);
|
||||
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
|
||||
use Illuminate\Contracts\Debug\ExceptionHandler as HandlerContract;
|
||||
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Toby\Console\Kernel as ConsoleKernel;
|
||||
use Toby\Exceptions\Handler;
|
||||
use Toby\Http\Kernel as HttpKernel;
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Http\Kernel::class,
|
||||
Toby\Http\Kernel::class,
|
||||
);
|
||||
$basePath = $_ENV["APP_BASE_PATH"] ?? dirname(__DIR__);
|
||||
$application = new Application($basePath);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Console\Kernel::class,
|
||||
Toby\Console\Kernel::class,
|
||||
);
|
||||
$application->singleton(HttpKernelContract::class, HttpKernel::class);
|
||||
$application->singleton(ConsoleKernelContract::class, ConsoleKernel::class);
|
||||
$application->singleton(HandlerContract::class, Handler::class);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Debug\ExceptionHandler::class,
|
||||
Toby\Exceptions\Handler::class,
|
||||
);
|
||||
|
||||
return $app;
|
||||
return $application;
|
||||
|
@ -16,6 +16,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"blumilksoftware/codestyle": "^0.9.0",
|
||||
"enlightn/enlightn": "^1.22",
|
||||
"facade/ignition": "^2.5",
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"mockery/mockery": "^1.4.4",
|
||||
|
1228
composer.lock
generated
1228
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Toby\Models\User;
|
||||
|
||||
return [
|
||||
"defaults" => [
|
||||
"guard" => "web",
|
||||
@ -16,7 +18,7 @@ return [
|
||||
"providers" => [
|
||||
"users" => [
|
||||
"driver" => "eloquent",
|
||||
"model" => Toby\Models\User::class,
|
||||
"model" => User::class,
|
||||
],
|
||||
],
|
||||
"passwords" => [
|
||||
|
68
config/enlightn.php
Normal file
68
config/enlightn.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
"analyzers" => ["*"],
|
||||
"exclude_analyzers" => [],
|
||||
"ci_mode_exclude_analyzers" => [],
|
||||
"analyzer_paths" => [
|
||||
"Enlightn\\Enlightn\\Analyzers" => base_path("vendor/enlightn/enlightn/src/Analyzers"),
|
||||
"Enlightn\\EnlightnPro\\Analyzers" => base_path("vendor/enlightn/enlightnpro/src/Analyzers"),
|
||||
],
|
||||
"base_path" => [
|
||||
app_path(),
|
||||
database_path("migrations"),
|
||||
database_path("seeders"),
|
||||
],
|
||||
"skip_env_specific" => env("ENLIGHTN_SKIP_ENVIRONMENT_SPECIFIC", false),
|
||||
"guest_url" => null,
|
||||
"dont_report" => [],
|
||||
"ignore_errors" => [],
|
||||
"license_whitelist" => [
|
||||
"Apache-2.0",
|
||||
"Apache2",
|
||||
"BSD-2-Clause",
|
||||
"BSD-3-Clause",
|
||||
"LGPL-2.1-only",
|
||||
"LGPL-2.1",
|
||||
"LGPL-2.1-or-later",
|
||||
"LGPL-3.0",
|
||||
"LGPL-3.0-only",
|
||||
"LGPL-3.0-or-later",
|
||||
"MIT",
|
||||
"ISC",
|
||||
"CC0-1.0",
|
||||
"Unlicense",
|
||||
"WTFPL",
|
||||
],
|
||||
"credentials" => [
|
||||
"username" => env("ENLIGHTN_USERNAME"),
|
||||
"api_token" => env("ENLIGHTN_API_TOKEN"),
|
||||
],
|
||||
"github_repo" => env("ENLIGHTN_GITHUB_REPO"),
|
||||
"compact_lines" => true,
|
||||
"commercial_packages" => [
|
||||
"enlightn/enlightnpro",
|
||||
],
|
||||
"allowed_permissions" => [
|
||||
base_path() => "775",
|
||||
app_path() => "775",
|
||||
resource_path() => "775",
|
||||
storage_path() => "775",
|
||||
public_path() => "775",
|
||||
config_path() => "775",
|
||||
database_path() => "775",
|
||||
base_path("routes") => "775",
|
||||
app()->bootstrapPath() => "775",
|
||||
app()->bootstrapPath("cache") => "775",
|
||||
app()->bootstrapPath("app.php") => "664",
|
||||
base_path("artisan") => "775",
|
||||
public_path("index.php") => "664",
|
||||
public_path("server.php") => "664",
|
||||
],
|
||||
"writable_directories" => [
|
||||
storage_path(),
|
||||
app()->bootstrapPath("cache"),
|
||||
],
|
||||
];
|
4
ecs.php
4
ecs.php
@ -5,9 +5,9 @@ declare(strict_types=1);
|
||||
use Blumilk\Codestyle\Config;
|
||||
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;
|
||||
|
||||
$paths = (new LaravelPaths())->add("public", "bootstrap/app.php", "ecs.php");
|
||||
$paths = new LaravelPaths();
|
||||
$config = new Config(
|
||||
paths: $paths,
|
||||
paths: $paths->add("public", "bootstrap/app.php", "ecs.php", "server.php"),
|
||||
);
|
||||
|
||||
return $config->config();
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "toby",
|
||||
"name": "application",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
@ -1,21 +0,0 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
<IfModule mod_negotiation.c>
|
||||
Options -MultiViews -Indexes
|
||||
</IfModule>
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
# Handle Authorization Header
|
||||
RewriteCond %{HTTP:Authorization} .
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
|
||||
# Redirect Trailing Slashes If Not A Folder...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} (.+)/$
|
||||
RewriteRule ^ %1 [L,R=301]
|
||||
|
||||
# Send Requests To Front Controller...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [L]
|
||||
</IfModule>
|
@ -1,6 +1,8 @@
|
||||

|
||||
|
||||
# Toby
|
||||
|
||||
HR software you love to hate
|
||||
> HR software you love to hate
|
||||
|
||||
## Local setup
|
||||
|
||||
@ -39,19 +41,22 @@ HR software you love to hate
|
||||
|
||||
dcr node npm run dev
|
||||
|
||||
## Available containers (local)
|
||||
### Available containers (local)
|
||||
|
||||
- **web** - nginx HTTP server
|
||||
- **php** - php and composer stuff
|
||||
- **node** - npm stuff
|
||||
- **mysql** - database for local development
|
||||
- **mailhog** - for emails preview
|
||||
|
||||
## Running tests
|
||||
### Running tests
|
||||
|
||||
If xDebug is installed, set environment variable **XDEBUG_MODE=off** to improve performance
|
||||
|
||||
dcr -e XDEBUG_MODE=off php php artisan test
|
||||
|
||||
### Code style check
|
||||
|
||||
## Code style check
|
||||
dcr php php vendor/bin/ecs check
|
||||
dcr php composer ecs
|
||||
dcr php php vendor/bin/ecs check --fix
|
||||
@ -59,13 +64,14 @@ If xDebug is installed, set environment variable **XDEBUG_MODE=off** to improve
|
||||
dcr node npm run lint
|
||||
dcr node rpm run lintf
|
||||
|
||||
## xDebug
|
||||
### xDebug
|
||||
|
||||
To use xDebug you need to set `DOCKER_INSTALL_XDEBUG` to `true` in `.env` file.\
|
||||
Then rebuild php container `docker-compose up --build -d php`.\
|
||||
You can also set up xDebug params (see docs https://xdebug.org/docs/all_settings) in `docker/dev/php/php.ini` file:
|
||||
* To use xDebug you need to set `DOCKER_INSTALL_XDEBUG` to `true` in `.env` file.
|
||||
* Then rebuild php container `docker-compose up --build -d php`.
|
||||
* You can also set up xDebug params (see docs https://xdebug.org/docs/all_settings) in `docker/dev/php/php.ini` file:
|
||||
|
||||
Default values for xDebug:
|
||||
|
||||
```
|
||||
xdebug.client_host=host.docker.internal
|
||||
xdebug.client_port=9003
|
||||
@ -74,16 +80,19 @@ xdebug.start_with_request=yes
|
||||
xdebug.log_level=0
|
||||
```
|
||||
|
||||
### Disable xDebug
|
||||
it is possible to disable the Xdebug completely by setting the option **xdebug.mode** to **off**,
|
||||
or by setting the environment variable **XDEBUG_MODE=off**\
|
||||
See docs (https://xdebug.org/docs/all_settings#mode)
|
||||
#### Disable xDebug
|
||||
|
||||
* It is possible to disable the Xdebug completely by setting the option **xdebug.mode** to **off**, or by setting the environment variable **XDEBUG_MODE=off**.
|
||||
* See docs: (https://xdebug.org/docs/all_settings#mode)
|
||||
|
||||
CLI:
|
||||
|
||||
```
|
||||
XDEBUG_MODE=off php artisan test
|
||||
```
|
||||
|
||||
Docker container:
|
||||
|
||||
```
|
||||
docker-compose run --rm -e XDEBUG_MODE=off php php artisan test
|
||||
```
|
@ -1,8 +1,3 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware("auth:sanctum")->get("/user", fn(Request $request) => $request->user());
|
||||
|
18
server.php
18
server.php
@ -1,21 +1,11 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Laravel - A PHP Framework For Web Artisans
|
||||
*
|
||||
* @package Laravel
|
||||
* @author Taylor Otwell <taylor@laravel.com>
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
$uri = urldecode(
|
||||
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
|
||||
);
|
||||
$uri = urldecode(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH));
|
||||
|
||||
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
|
||||
// built-in PHP web server. This provides a convenient way to test a Laravel
|
||||
// application without having installed a "real" web server software here.
|
||||
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
|
||||
if ($uri !== "/" && file_exists(__DIR__ . "/public" . $uri)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
require_once __DIR__.'/public/index.php';
|
||||
require_once __DIR__ . "/public/index.php";
|
||||
|
@ -6,4 +6,4 @@ module.exports = {
|
||||
'@': path.resolve('resources/js')
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user