Skip to content

Commit

Permalink
Merge pull request #3 from openjournalteam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rahmanramsi authored Jul 21, 2021
2 parents 2477687 + be60d39 commit 451917f
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 3 deletions.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Run the following to use the latest stable version
```php
php artisan core:install
```
Edit config/auth.php and add the following lines:
Edit config/auth.php and change the following lines:
```php
'providers' => [
'users' => [
Expand All @@ -37,6 +37,55 @@ To
],
```

Edit .env and change the following lines:
```php
DB_CONNECTION=mysql
```

To
```php
DB_CONNECTION=sqlite
```

And remove the following lines:
```php
DB_DATABASE=laravel
```

Edit composer.json and change the following lines:
```json
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
}
```

To
```json
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/",
"Plugins\\": "plugins/"
}
}
```

Tip: don't forget to run composer dump-autoload afterwards

Serve Laravel
```php
php artisan serve
```

Access the admin panel
```php
http://localhost:8000/panel
```


### Changelog
Expand Down
Binary file added database/database.sqlite
Binary file not shown.
93 changes: 93 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Basic Usage

## Configuration

#### Enabled

key : ```enabled```
default : ```true```

#### middleware

key : ```middleware```
default : ```['web']```

#### path

key : ```path```
default : ```'/panel'```

#### title

key : ```title```
default : ```'Panel'```


## Helpers
#### add_action
```php
add_action(string $name, string $callback, int $priority = 10, int $accepted_args = 1);
```

#### do_action
```php
do_action(string $name, ...$args);
```

#### add_filter
```php
add_filter(string $name, string $callback, int $priority = 10, int $accepted_args = 1);
```

#### apply_filters
```php
apply_filters(string $name, ...$args);
```

#### remove_action
```php
remove_action(string $name, string $callback);
```

#### remove_filter
```php
remove_filter(string $name, string $callback);
```

#### has_action
```php
has_action(string $name);
```

#### has_filter
```php
has_filter(string $name);
```

#### add_style
```php
add_style($href, $async = false);
```

#### add_script
```php
add_script($src, $async = false);
```

#### render
```php
render($view = null, $data = [], $mergeData = [], $template = 'core::template.default');
```

## Facade
#### Add Style
```php
Core::add_style($href, $async = false);
```

#### Add Script
```php
Core::add_script($src, $defer = false);
```


3 changes: 3 additions & 0 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public function handle()
$this->comment('Publishing Core Configuration...');
$this->callSilent('vendor:publish', ['--tag' => 'Core-config']);

$this->comment('Publishing Core Databases...');
$this->callSilent('vendor:publish', ['--tag' => 'Core-databases']);

$this->info('Core scaffolding installed successfully.');
}
}
7 changes: 5 additions & 2 deletions src/CoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function register()

// Register Provider
$this->app->register(RouteServiceProvider::class);
$this->app->register(\Shohel\Pluggable\PluggableServiceProvider::class);

// Register the main class to use with the facade
$this->app->singleton('core', function () {
Expand All @@ -63,6 +64,9 @@ protected function registerCommands()
$this->publishes([
__DIR__ . '/../public' => public_path('vendor/core'),
], 'Core-assets');
$this->publishes([
__DIR__ . '/../database/database.sqlite' => database_path('database.sqlite'),
], 'Core-databases');

$this->commands([
Console\InstallCommand::class,
Expand All @@ -79,6 +83,5 @@ private function registerMiddlewareAlias()

private function registerBladeDirective()
{
}

}
}

0 comments on commit 451917f

Please sign in to comment.