Skip to content

Commit

Permalink
[Added] Theme Feature and Updated Page Routes
Browse files Browse the repository at this point in the history
  • Loading branch information
dipaksarkar committed Oct 5, 2024
1 parent 3f8c509 commit f2a2c13
Show file tree
Hide file tree
Showing 70 changed files with 2,041 additions and 668 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
[*.{yml,yaml,js,json}]
indent_size = 2
234 changes: 118 additions & 116 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,120 +1,122 @@
{
"name": "coderstm/laravel-core",
"description": "Laravel Core package that provides essential core functionalities and utilities for Laravel applications.",
"keywords": [
"laravel",
"sanctum",
"auth",
"enquiry",
"multi auth guard",
"tasks management",
"log",
"subscription"
],
"license": "MIT",
"support": {
"issues": "https://github.com/coders-tm/laravel-core/issues",
"source": "https://github.com/coders-tm/laravel-core"
},
"authors": [
{
"name": "Dipak Sarkar",
"email": "hello@dipaksarkar.in"
}
],
"require": {
"php": "^8.1",
"ext-json": "*",
"barryvdh/laravel-dompdf": "^2.0",
"creativeorange/gravatar": "^1.0",
"doctrine/dbal": "^3.4",
"illuminate/console": "^11.0",
"illuminate/contracts": "^11.0",
"illuminate/database": "^11.0",
"illuminate/http": "^11.0",
"illuminate/log": "^11.0",
"illuminate/notifications": "^11.0",
"illuminate/pagination": "^11.0",
"illuminate/routing": "^11.0",
"illuminate/support": "^11.0",
"illuminate/view": "^11.0",
"jenssegers/agent": "^2.6",
"kreait/firebase-php": "^7.9",
"laravel/cashier": "^15.0",
"laravel/sanctum": "^4.0",
"league/csv": "^9.15",
"league/iso3166": "^4.3",
"nesbot/carbon": "^3.0",
"razorpay/razorpay": "^2.9",
"simplesoftwareio/simple-qrcode": "^4.2",
"spatie/laravel-sluggable": "^3.4",
"srmklive/paypal": "^3.0",
"stevebauman/location": "^7.2.0",
"symfony/console": "^7.0",
"symfony/http-kernel": "^7.0",
"symfony/polyfill-intl-icu": "^1.22.1",
"twilio/sdk": "^7.16",
"vedmant/laravel-shortcodes": "^1.1"
},
"require-dev": {
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^8.1",
"orchestra/testbench": "^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4"
},
"autoload": {
"psr-4": {
"Coderstm\\": "src/",
"Coderstm\\Database\\Factories\\": "database/factories/",
"Coderstm\\Database\\Seeders\\": "database/seeders/"
},
"files": [
"lib/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Coderstm\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"extra": {
"laravel": {
"providers": [
"Coderstm\\Providers\\CoderstmServiceProvider",
"Coderstm\\Providers\\CoderstmPermissionsServiceProvider",
"Coderstm\\Providers\\CoderstmEventServiceProvider",
"Coderstm\\Providers\\FirebaseMessagingServiceProvider",
"Coderstm\\Providers\\ShortcodeServiceProvider"
]
}
},
"config": {
"sort-packages": true
"name": "coderstm/laravel-core",
"description": "Laravel Core package that provides essential core functionalities and utilities for Laravel applications.",
"keywords": [
"laravel",
"sanctum",
"auth",
"enquiry",
"multi auth guard",
"tasks management",
"log",
"subscription"
],
"license": "MIT",
"support": {
"issues": "https://github.com/coders-tm/laravel-core/issues",
"source": "https://github.com/coders-tm/laravel-core"
},
"authors": [
{
"name": "Dipak Sarkar",
"email": "hello@dipaksarkar.in"
}
],
"require": {
"php": "^8.1",
"ext-json": "*",
"barryvdh/laravel-dompdf": "^2.0",
"creativeorange/gravatar": "^1.0",
"doctrine/dbal": "^3.4",
"illuminate/console": "^11.0",
"illuminate/contracts": "^11.0",
"illuminate/database": "^11.0",
"illuminate/http": "^11.0",
"illuminate/log": "^11.0",
"illuminate/notifications": "^11.0",
"illuminate/pagination": "^11.0",
"illuminate/routing": "^11.0",
"illuminate/support": "^11.0",
"illuminate/view": "^11.0",
"jenssegers/agent": "^2.6",
"kreait/firebase-php": "^7.9",
"laravel/cashier": "^15.0",
"laravel/sanctum": "^4.0",
"league/csv": "^9.15",
"league/iso3166": "^4.3",
"nesbot/carbon": "^3.0",
"qirolab/laravel-themer": "^2.3",
"razorpay/razorpay": "^2.9",
"simplesoftwareio/simple-qrcode": "^4.2",
"spatie/laravel-sluggable": "^3.4",
"srmklive/paypal": "^3.0",
"stevebauman/location": "^7.2.0",
"symfony/console": "^7.0",
"symfony/http-kernel": "^7.0",
"symfony/polyfill-intl-icu": "^1.22.1",
"twilio/sdk": "^7.16",
"vedmant/laravel-shortcodes": "^1.1"
},
"require-dev": {
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^8.1",
"orchestra/testbench": "^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4"
},
"autoload": {
"psr-4": {
"Coderstm\\": "src/",
"Coderstm\\Database\\Factories\\": "database/factories/",
"Coderstm\\Database\\Seeders\\": "database/seeders/"
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"@clear",
"@prepare"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve --ansi"
],
"lint": [
"@php vendor/bin/phpstan analyse --verbose --ansi"
],
"test": [
"@php vendor/bin/phpunit"
]
"files": [
"lib/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Coderstm\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"extra": {
"laravel": {
"providers": [
"Coderstm\\Providers\\ThemeServiceProvider",
"Coderstm\\Providers\\CoderstmServiceProvider",
"Coderstm\\Providers\\CoderstmPermissionsServiceProvider",
"Coderstm\\Providers\\CoderstmEventServiceProvider",
"Coderstm\\Providers\\ShortcodeServiceProvider",
"Coderstm\\Providers\\FirebaseMessagingServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"@clear",
"@prepare"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve --ansi"
],
"lint": [
"@php vendor/bin/phpstan analyse --verbose --ansi"
],
"test": [
"@php vendor/bin/phpunit"
]
}
}
19 changes: 19 additions & 0 deletions config/coderstm.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,23 @@
'app_url' => env('APP_MEMBER_URL', 'http://localhost/user'),
'admin_url' => env('APP_ADMIN_URL', 'http://localhost/admins'),

/*
|--------------------------------------------------------------------------
| Theme Public Path
|--------------------------------------------------------------------------
|
| This value determines the public path used in the Webpack build process
| for themes. The `MIX_THEME_PUBLIC` environment variable allows the
| Laravel Mix configuration (found in `webpack.theme.js`) to differentiate
| between default theme paths and custom theme paths.
|
| If the environment variable `MIX_THEME_PUBLIC` is set to "theme", the build
| will output files to `themes/{themeName}/public`. Otherwise, it defaults to
| `public/themes/{themeName}`. This setup allows for flexibility in managing
| theme assets in different directory structures, especially when multiple
| themes are involved.
|
*/

'theme_public' => env('MIX_THEME_PUBLIC', null),
];
1 change: 1 addition & 0 deletions database/factories/Shop/OrderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function definition()
return [
'location_id' => Location::inRandomOrder()->first()->id,
'collect_tax' => rand(0, 1),
'created_at' => fake()->dateTimeBetween('-3 years'),
];
}
}
29 changes: 27 additions & 2 deletions lib/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

use Coderstm\Coderstm;
use Coderstm\Models\Tax;
use League\ISO3166\ISO3166;
use Coderstm\Services\Mix;
use Illuminate\Support\Str;
use League\ISO3166\ISO3166;
use Coderstm\Services\Theme;
use Laravel\Cashier\Cashier;
use Coderstm\Models\AppSetting;
use Illuminate\Support\Optional;
use Symfony\Polyfill\Intl\Icu\Currencies;
use Illuminate\Support\Facades\Notification;
use Laravel\Cashier\Cashier;

if (!function_exists('guard')) {
function guard()
Expand Down Expand Up @@ -129,6 +131,13 @@ function app_settings($key)
}
}

if (!function_exists('settings')) {
function settings(string $key, string $attribute)
{
return AppSetting::value($key, $attribute);
}
}

if (!function_exists('opening_times')) {
function opening_times()
{
Expand Down Expand Up @@ -387,3 +396,19 @@ function html_text($html = '')
return trim(preg_replace('/\s+/', ' ', strip_tags($html)));
}
}

if (! function_exists('theme')) {
/**
* Get the path to a versioned theme's Mix file.
*
* @param string $path
* @param string $themeName
* @return \Illuminate\Support\HtmlString|string
*
* @throws \Exception
*/
function theme($path, $themeName = null)
{
return app(Mix::class)(...func_get_args());
}
}
10 changes: 0 additions & 10 deletions public/css/styles.css

This file was deleted.

12 changes: 12 additions & 0 deletions public/css/styles.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/views/includes/sub-menu.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ $item['label'] }}
</a>
@if (isset($item['items']) && count($item['items']))
@include('coderstm::includes.sub-menu', $item)
@include('includes.sub-menu', $item)
@endif
</li>
@endforeach
Expand Down
38 changes: 38 additions & 0 deletions resources/views/layouts/error.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="Fitness, Wellbeing Centre" />
<meta name="description" content="Fitness & Wellbeing Centre | Farsley, Leeds, LS28 5LY" />
<meta name="author" content="{{ config('app.url') }}" />
<meta name="viewport" content=" width=device-width, initial-scale=1" />
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>
{{ $title }} | {{ config('app.name') }}
</title>
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://cdn.coderstm.com">
<link rel="stylesheet" type="text/css" href="https://cdn.coderstm.com/fontawesome/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="{{ asset('statics/css/styles.min.css') }}" />

{{-- App Style --}}
<link rel="stylesheet" type="text/css" href="{{ theme('css/app.css', 'foundation') }}" />

@yield('style')
</head>

<body>
[header layout="classic"]

<div style="padding: 30px 0px">
@yield('message')
</div>

[footer]
</body>

</html>
Loading

0 comments on commit f2a2c13

Please sign in to comment.