From b7ccbbca07812bafa5a9694dc96bf4bdca683ad3 Mon Sep 17 00:00:00 2001 From: Ben Rutland Date: Wed, 24 Feb 2021 11:47:03 +0000 Subject: [PATCH 1/7] added theme provider --- app/Providers/RouteServiceProvider.php | 4 ++++ app/Providers/ThemeServiceProvider.php | 28 ++++++++++++++++++++++++++ functions.php | 1 + 3 files changed, 33 insertions(+) create mode 100644 app/Providers/ThemeServiceProvider.php diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 0eeec86..ddd1932 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -22,6 +22,8 @@ public function map() /** * Map the AJAX routes * + * These routes all receive CSRF protection, etc. + * * @return void */ public function mapAjaxRoutes() @@ -33,6 +35,8 @@ public function mapAjaxRoutes() /** * Map the API routes * + * These routes are stateless. + * * @return void */ public function mapApiRoutes() diff --git a/app/Providers/ThemeServiceProvider.php b/app/Providers/ThemeServiceProvider.php new file mode 100644 index 0000000..6ce7266 --- /dev/null +++ b/app/Providers/ThemeServiceProvider.php @@ -0,0 +1,28 @@ +register(Theme\Providers\EventServiceProvider::class); $app->register(Theme\Providers\RouteServiceProvider::class); +$app->register(Theme\Providers\ThemeServiceProvider::class); $app->register(Theme\Providers\WordPressServiceProvider::class); From 8d6c8fd797ae0686a52fa622053ccbe8ea7989bd Mon Sep 17 00:00:00 2001 From: Ben Rutland Date: Wed, 7 Apr 2021 18:59:50 +0100 Subject: [PATCH 2/7] updated theme files to work with v2 of framework --- app/Models/Category.php | 15 +++++++++++++++ app/Models/Page.php | 15 +++++++++++++++ app/Models/Post.php | 15 +++++++++++++++ app/Models/PostTag.php | 15 +++++++++++++++ app/Models/User.php | 10 ++++++++++ config/app.php | 15 +++++++++++++++ config/auth.php | 40 ++++++++++++++++++++++++++++++++++++++++ functions.php | 1 + 8 files changed, 126 insertions(+) create mode 100644 app/Models/Category.php create mode 100644 app/Models/Page.php create mode 100644 app/Models/Post.php create mode 100644 app/Models/PostTag.php create mode 100644 app/Models/User.php create mode 100644 config/app.php create mode 100644 config/auth.php diff --git a/app/Models/Category.php b/app/Models/Category.php new file mode 100644 index 0000000..8e22fb0 --- /dev/null +++ b/app/Models/Category.php @@ -0,0 +1,15 @@ + get_stylesheet_directory_uri() . '/assets/', +]; diff --git a/config/auth.php b/config/auth.php new file mode 100644 index 0000000..bb57aac --- /dev/null +++ b/config/auth.php @@ -0,0 +1,40 @@ + 'radiate', + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are accessed from the authentication system. + | + */ + + 'providers' => [ + + 'radiate' => [ + 'driver' => 'radiate', + 'model' => \Theme\Models\User::class, + ], + + 'wordpress' => [ + 'driver' => 'wordpress', + ], + ], +]; diff --git a/functions.php b/functions.php index 18b2a40..4518d9a 100644 --- a/functions.php +++ b/functions.php @@ -68,6 +68,7 @@ */ $app->register(Radiate\Auth\AuthServiceProvider::class); +$app->register(Radiate\Database\DatabaseServiceProvider::class); $app->register(Radiate\Foundation\Providers\FormRequestServiceProvider::class); $app->register(Radiate\Mail\MailServiceProvider::class); $app->register(Radiate\Routing\RoutingServiceProvider::class); From 95c50752909b398d1e4fe5a750285b433770695d Mon Sep 17 00:00:00 2001 From: Ben Rutland Date: Tue, 11 May 2021 22:09:06 +0100 Subject: [PATCH 3/7] updated functions file with v2 aliases and providers --- functions.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/functions.php b/functions.php index 4518d9a..474aceb 100644 --- a/functions.php +++ b/functions.php @@ -53,6 +53,7 @@ 'api' => [ // ], + 'signed' => Radiate\Routing\Middleware\ValidateSignature::class, ]); @@ -68,6 +69,7 @@ */ $app->register(Radiate\Auth\AuthServiceProvider::class); +$app->register(Radiate\Cache\CacheServiceProvider::class); $app->register(Radiate\Database\DatabaseServiceProvider::class); $app->register(Radiate\Foundation\Providers\FormRequestServiceProvider::class); $app->register(Radiate\Mail\MailServiceProvider::class); @@ -82,6 +84,39 @@ $app->register(Theme\Providers\WordPressServiceProvider::class); +/** + * ----------------------------------------------------------------------------- + * Class Aliases + * ----------------------------------------------------------------------------- + * + * This array of class aliases will be registered when this application + * is started. However, feel free to register as many as you wish as + * the aliases are "lazy" loaded so they don't hinder performance. + * + */ + +$app->aliases([ + 'App' => \Radiate\Support\Facades\App::class, + 'Arr' => \Radiate\Support\Arr::class, + 'Auth' => \Radiate\Support\Facades\Auth::class, + 'Cache' => \Radiate\Support\Facades\Cache::class, + 'Collection' => \Radiate\Support\Collection::class, + 'Config' => \Radiate\Support\Facades\Config::class, + 'DB' => \Radiate\Support\Facades\DB::class, + 'Event' => \Radiate\Support\Facades\Event::class, + 'File' => \Radiate\Support\Facades\File::class, + 'Hash' => \Radiate\Support\Hash::class, + 'Http' => \Radiate\Support\Facades\Http::class, + 'Mail' => \Radiate\Support\Facades\Mail::class, + 'Request' => \Radiate\Support\Facades\Request::class, + 'Route' => \Radiate\Support\Facades\Route::class, + 'Str' => \Radiate\Support\Str::class, + 'URL' => \Radiate\Support\Facades\URL::class, + 'Validator' => \Radiate\Support\Facades\Validator::class, + 'View' => \Radiate\Support\Facades\View::class, +]); + + /** * ----------------------------------------------------------------------------- * Run The Application From 55a9eb72f941eefab72869ba0f1af6b8efa9d2d1 Mon Sep 17 00:00:00 2001 From: Ben Rutland Date: Tue, 11 May 2021 22:10:06 +0100 Subject: [PATCH 4/7] updated radiate framework version to 2.x-alpha --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2cb2b71..678bbdb 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "require": { "php": "^7.3", - "radiate/framework": "^1.0" + "radiate/framework": "dev-2.x-alpha" }, "scripts": { "post-create-project-cmd": [ From 787e2a5097e244e197c6de2576ce3fc5e81d77a8 Mon Sep 17 00:00:00 2001 From: Ben Rutland Date: Tue, 15 Jun 2021 21:38:24 +0100 Subject: [PATCH 5/7] added scheduler --- app/Providers/ScheduleServiceProvider.php | 20 ++++++++++++++++++++ functions.php | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 app/Providers/ScheduleServiceProvider.php diff --git a/app/Providers/ScheduleServiceProvider.php b/app/Providers/ScheduleServiceProvider.php new file mode 100644 index 0000000..9154d63 --- /dev/null +++ b/app/Providers/ScheduleServiceProvider.php @@ -0,0 +1,20 @@ +register(Radiate\Foundation\Providers\FormRequestServiceProvider::class); $app->register(Radiate\Mail\MailServiceProvider::class); $app->register(Radiate\Routing\RoutingServiceProvider::class); +$app->register(Radiate\Schedule\ScheduleServiceProvider::class); $app->register(Radiate\Validation\ValidationServiceProvider::class); $app->register(Radiate\View\ViewServiceProvider::class); $app->register(Radiate\WordPress\WordPressServiceProvider::class); $app->register(Theme\Providers\EventServiceProvider::class); $app->register(Theme\Providers\RouteServiceProvider::class); +$app->register(Theme\Providers\ScheduleServiceProvider::class); $app->register(Theme\Providers\ThemeServiceProvider::class); $app->register(Theme\Providers\WordPressServiceProvider::class); + /** * ----------------------------------------------------------------------------- * Class Aliases @@ -108,6 +111,7 @@ 'Hash' => \Radiate\Support\Hash::class, 'Http' => \Radiate\Support\Facades\Http::class, 'Mail' => \Radiate\Support\Facades\Mail::class, + 'Option' => \Radiate\Support\Facades\Option::class, 'Request' => \Radiate\Support\Facades\Request::class, 'Route' => \Radiate\Support\Facades\Route::class, 'Str' => \Radiate\Support\Str::class, From 58a7199b05957ae9a9476eaffac07cf63f8e0fba Mon Sep 17 00:00:00 2001 From: Ben Rutland Date: Thu, 26 Aug 2021 20:40:25 +0100 Subject: [PATCH 6/7] updated auth middleware --- config/auth.php | 61 +++++++++++++++++++++++++++++++++++++++---------- functions.php | 11 +++------ 2 files changed, 52 insertions(+), 20 deletions(-) diff --git a/config/auth.php b/config/auth.php index bb57aac..ad10a27 100644 --- a/config/auth.php +++ b/config/auth.php @@ -4,17 +4,47 @@ /* |-------------------------------------------------------------------------- - | Authentication Provider Default + | Authentication Defaults |-------------------------------------------------------------------------- | - | This option controls the default authentication "provider". You may - | change this default as required. + | This option controls the default authentication "guard" and password + | reset options for your application. You may change these defaults + | as required, but they're a perfect start for most applications. | - | Supported: "radiate", "wordpress" + */ + + 'defaults' => [ + 'guard' => 'web', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session" | */ - 'default' => 'radiate', + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + # 'api' => [ + # 'driver' => 'session', + # 'provider' => 'users', + # ], + ], /* |-------------------------------------------------------------------------- @@ -22,19 +52,26 @@ |-------------------------------------------------------------------------- | | All authentication drivers have a user provider. This defines how the - | users are accessed from the authentication system. + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "wordpress", "radiate" | */ 'providers' => [ + # 'users' => [ + # 'driver' => 'wordpress', + # 'table' => 'users', + # ], - 'radiate' => [ + 'users' => [ 'driver' => 'radiate', - 'model' => \Theme\Models\User::class, - ], - - 'wordpress' => [ - 'driver' => 'wordpress', + 'model' => \Theme\Models\User::class, ], ], ]; diff --git a/functions.php b/functions.php index 658b745..42ad195 100644 --- a/functions.php +++ b/functions.php @@ -46,14 +46,9 @@ ]); $app->routeMiddleware([ - 'auth' => Radiate\Auth\Middleware\Authenticate::class, - 'ajax' => [ - // - ], - 'api' => [ - // - ], - 'signed' => Radiate\Routing\Middleware\ValidateSignature::class, + 'auth' => Radiate\Auth\Middleware\Authenticate::class, + 'auth.basic' => Radiate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'signed' => Radiate\Routing\Middleware\ValidateSignature::class, ]); From aa2242d8f148e2be76130298d19226fbafb4948b Mon Sep 17 00:00:00 2001 From: Ben Rutland Date: Thu, 26 Aug 2021 20:49:31 +0100 Subject: [PATCH 7/7] bumped radiate framework to version 2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 678bbdb..4d87ee6 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "require": { "php": "^7.3", - "radiate/framework": "dev-2.x-alpha" + "radiate/framework": "^2.0" }, "scripts": { "post-create-project-cmd": [