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

add themes / features / builder / pages #37

Merged
merged 1 commit into from
Mar 28, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file.
67 changes: 67 additions & 0 deletions Modules/CircleApps/App/Http/Controllers/CircleAppsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace Modules\CircleApps\App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

class CircleAppsController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('circleapps::index');
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('circleapps::create');
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}

/**
* Show the specified resource.
*/
public function show($id)
{
return view('circleapps::show');
}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('circleapps::edit');
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}
Empty file.
114 changes: 114 additions & 0 deletions Modules/CircleApps/App/Providers/CircleAppsServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php

namespace Modules\CircleApps\App\Providers;

use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

class CircleAppsServiceProvider extends ServiceProvider
{
protected string $moduleName = 'CircleApps';

protected string $moduleNameLower = 'circleapps';

/**
* Boot the application events.
*/
public function boot(): void
{
$this->registerCommands();
$this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/migrations'));
}

/**
* Register the service provider.
*/
public function register(): void
{
$this->app->register(RouteServiceProvider::class);
}

/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
{
// $this->commands([]);
}

/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
{
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
// $schedule->command('inspire')->hourly();
// });
}

/**
* Register translations.
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);

if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
}
}

/**
* Register config.
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}

/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');

$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);

$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);

$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.config('modules.paths.generator.component-class.path'));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
}

/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}

private function getPublishableViewPaths(): array
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
$paths[] = $path.'/modules/'.$this->moduleNameLower;
}
}

return $paths;
}
}
59 changes: 59 additions & 0 deletions Modules/CircleApps/App/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace Modules\CircleApps\App\Providers;

use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*/
protected string $moduleNamespace = 'Modules\CircleApps\App\Http\Controllers';

/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
{
parent::boot();
}

/**
* Define the routes for the application.
*/
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('CircleApps', '/routes/web.php'));
}

/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
{
Route::prefix('api')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('CircleApps', '/routes/api.php'));
}
}
Empty file added Modules/CircleApps/CHANGELOG.md
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions Modules/CircleApps/Database/Seeders/CircleAppsDatabaseSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Modules\CircleApps\Database\Seeders;

use Illuminate\Database\Seeder;

class CircleAppsDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}
21 changes: 21 additions & 0 deletions Modules/CircleApps/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Fady Mondy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
29 changes: 29 additions & 0 deletions Modules/CircleApps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Circle Apps

Manage Apps Inside CircleXO Profile

## Installation

```bash
composer require tomatophp/CircleApps
```

## Support

you can join our discord server to get support [TomatoPHP](https://discord.gg/Xqmt35Uh)

## Docs

you can check docs of this package on [Docs](https://docs.tomatophp.com/plugins/tomato-themes)

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Security

Please see [SECURITY](SECURITY.md) for more information about security.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
Empty file added Modules/CircleApps/SECURITY.md
Empty file.
31 changes: 31 additions & 0 deletions Modules/CircleApps/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "nwidart/circleapps",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {

}
}
},
"autoload": {
"psr-4": {
"Modules\\CircleApps\\": "",
"Modules\\CircleApps\\App\\": "app/",
"Modules\\CircleApps\\Database\\Factories\\": "database/factories/",
"Modules\\CircleApps\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\CircleApps\\Tests\\": "tests/"
}
}
}
Empty file.
5 changes: 5 additions & 0 deletions Modules/CircleApps/config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'name' => 'CircleApps',
];
28 changes: 28 additions & 0 deletions Modules/CircleApps/module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "CircleApps",
"alias": "circleapps",
"description": {
"ar": "Manage Apps Inside CircleXO Profile",
"en": "Manage Apps Inside CircleXO Profile",
"gr": "Manage Apps Inside CircleXO Profile",
"sp": "Manage Apps Inside CircleXO Profile"
},
"keywords": [],
"priority": 0,
"providers": [
"Modules\\CircleApps\\App\\Providers\\CircleAppsServiceProvider"
],
"files": [],
"title": {
"ar": "Circle Apps",
"en": "Circle Apps",
"gr": "Circle Apps",
"sp": "Circle Apps"
},
"color": "#1FBC9C",
"icon": "bx bx-card",
"placeholder": "placeholder.webp",
"type": "plugin",
"version": "v1.0",
"active": false
}
15 changes: 15 additions & 0 deletions Modules/CircleApps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5",
"sass": "^1.69.5",
"postcss": "^8.3.7",
"vite": "^4.0.0"
}
}
Empty file.
Empty file.
Empty file.
Loading
Loading