Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ composer.lock
resources/assets/minify-manifest.json
resources/assets/open-admin.min.css
resources/assets/open-admin.min.js
./.phpunit.result.cache
6 changes: 6 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


```shell
php vendor/bin/testbench vendor:publish --provider="OpenAdmin\Admin\AdminServiceProvider"
php vendor/bin/testbench-dusk vendor:publish --provider="OpenAdmin\Admin\AdminServiceProvider"
```
61 changes: 42 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
"name": "open-admin-org/open-admin",
"description": "open-admin. Open-source Laravel Admin panel. No pro or paid package, free & open. Based on laravel-admin, with special thanks to z-song",
"type": "library",
"keywords": ["laravel", "admin", "grid", "form", "open-admin","open","free"],
"keywords": [
"laravel",
"admin",
"grid",
"form",
"open-admin",
"open",
"free"
],
"homepage": "https://github.com/open-admin-org/open-admin",
"license": "MIT",
"authors": [
Expand All @@ -12,17 +20,11 @@
}
],
"require": {
"php": "~7.3|~8.0",
"symfony/dom-crawler": "~3.1|~4.0|~5.0",
"laravel/framework": ">=7.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you need to maintain something like this "laravel/framework": ">=11.0",

"doctrine/dbal": "2.*|3.*"
"php": ">=8.2"
},
"require-dev": {
"laravel/laravel": ">=8.0",
"fzaninotto/faker": "~1.4",
"intervention/image": "~2.3",
"laravel/browser-kit-testing": "^6.0",
"spatie/phpunit-watcher": "^1.22.0"
"orchestra/testbench-dusk": "^9.0"
},
"autoload": {
"psr-4": {
Expand All @@ -34,16 +36,36 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\Models\\": "tests/models",
"Tests\\Controllers\\": "tests/controllers"
},
"classmap": [
"tests/TestCase.php"
]
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/",
"Tests\\": "tests/"
}
},
"scripts": {
"sass": "sass --watch resources/assets/open-admin/scss/styles.scss:resources/assets/open-admin/css/styles.css resources/assets/open-admin/scss/pages:resources/assets/open-admin/css/pages --style compressed",
"test": "./vendor/bin/phpunit"
"old:sass": "sass --watch resources/assets/open-admin/scss/styles.scss:resources/assets/open-admin/css/styles.css resources/assets/open-admin/scss/pages:resources/assets/open-admin/css/pages --style compressed",
"test:feature": "@php vendor/bin/phpunit --testsuite=Feature",
"test:browser": "@php vendor/bin/phpunit --testsuite=Browser",
"post-autoload-dump": [
"@clear",
"@prepare",
"@dusk:install-chromedriver"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"dusk:install-chromedriver": "@php vendor/bin/dusk-updater detect --auto-update --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve"
],
"lint": [
"@php vendor/bin/phpstan analyse"
],
"test": [
"@php vendor/bin/phpunit"
]
},
"suggest": {
"intervention/image": "Required to handling and manipulation upload images (~2.3).",
Expand All @@ -61,5 +83,6 @@
},
"config": {
"process-timeout": 0
}
}
},
"minimum-stability": "dev"
}
29 changes: 15 additions & 14 deletions database/migrations/2016_01_04_173148_create_admin_tables.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminTables extends Migration
{
return new class extends Migration {
/**
* {@inheritdoc}
*/
Expand All @@ -19,9 +20,9 @@ public function getConnection()
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create(config('admin.database.users_table'), function (Blueprint $table) {
Schema::create(config('admin.database.users_table'), static function (Blueprint $table) {
$table->increments('id');
$table->string('username', 190)->unique();
$table->string('password', 60);
Expand All @@ -31,14 +32,14 @@ public function up()
$table->timestamps();
});

Schema::create(config('admin.database.roles_table'), function (Blueprint $table) {
Schema::create(config('admin.database.roles_table'), static function (Blueprint $table) {
$table->increments('id');
$table->string('name', 50)->unique();
$table->string('slug', 50)->unique();
$table->timestamps();
});

Schema::create(config('admin.database.permissions_table'), function (Blueprint $table) {
Schema::create(config('admin.database.permissions_table'), static function (Blueprint $table) {
$table->increments('id');
$table->string('name', 50)->unique();
$table->string('slug', 50)->unique();
Expand All @@ -47,7 +48,7 @@ public function up()
$table->timestamps();
});

Schema::create(config('admin.database.menu_table'), function (Blueprint $table) {
Schema::create(config('admin.database.menu_table'), static function (Blueprint $table) {
$table->increments('id');
$table->integer('parent_id')->default(0);
$table->integer('order')->default(0);
Expand All @@ -59,35 +60,35 @@ public function up()
$table->timestamps();
});

Schema::create(config('admin.database.role_users_table'), function (Blueprint $table) {
Schema::create(config('admin.database.role_users_table'), static function (Blueprint $table) {
$table->integer('role_id');
$table->integer('user_id');
$table->index(['role_id', 'user_id']);
$table->timestamps();
});

Schema::create(config('admin.database.role_permissions_table'), function (Blueprint $table) {
Schema::create(config('admin.database.role_permissions_table'), static function (Blueprint $table) {
$table->integer('role_id');
$table->integer('permission_id');
$table->index(['role_id', 'permission_id']);
$table->timestamps();
});

Schema::create(config('admin.database.user_permissions_table'), function (Blueprint $table) {
Schema::create(config('admin.database.user_permissions_table'), static function (Blueprint $table) {
$table->integer('user_id');
$table->integer('permission_id');
$table->index(['user_id', 'permission_id']);
$table->timestamps();
});

Schema::create(config('admin.database.role_menu_table'), function (Blueprint $table) {
Schema::create(config('admin.database.role_menu_table'), static function (Blueprint $table) {
$table->integer('role_id');
$table->integer('menu_id');
$table->index(['role_id', 'menu_id']);
$table->timestamps();
});

Schema::create(config('admin.database.operation_log_table'), function (Blueprint $table) {
Schema::create(config('admin.database.operation_log_table'), static function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('path');
Expand All @@ -104,7 +105,7 @@ public function up()
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists(config('admin.database.users_table'));
Schema::dropIfExists(config('admin.database.roles_table'));
Expand All @@ -116,4 +117,4 @@ public function down()
Schema::dropIfExists(config('admin.database.role_menu_table'));
Schema::dropIfExists(config('admin.database.operation_log_table'));
}
}
};
44 changes: 29 additions & 15 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd"
cacheDirectory=".phpunit.cache"
stopOnFailure="true"
verbose="true"
>
<testsuites>
<testsuite name="all">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
stopOnError="true"
>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<!-- <env name="APP_MAINTENANCE_DRIVER" value="file"/>-->
<!-- <env name="BCRYPT_ROUNDS" value="4"/>-->
<!-- <env name="CACHE_STORE" value="array"/>-->
<!-- <env name="DB_CONNECTION" value="sqlite"/>-->
<!-- <env name="DB_DATABASE" value=":memory:"/>-->
<!-- <env name="MAIL_MAILER" value="array"/>-->
<!-- <env name="PULSE_ENABLED" value="false"/>-->
<!-- <env name="QUEUE_CONNECTION" value="sync"/>-->
<!-- <env name="SESSION_DRIVER" value="file"/>-->
<!-- <env name="TELESCOPE_ENABLED" value="false"/>-->
</php>
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="Browser">
<directory suffix="Test.php">./tests/Browser</directory>
</testsuite>
</testsuites>
</phpunit>
18 changes: 18 additions & 0 deletions phpunit.xml.dist.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
verbose="true"
>
<testsuites>
<testsuite name="all">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
Loading