You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried adding the post generator function to my AppServiceProvider as the documentation suggests but I ran into an issue:
ErrorException : Non-static method Statamic\StaticSite\Generator::after() should not be called statically
at /.../app/Providers/AppServiceProvider.php:2117| {
18| // Statamic::script('app', 'cp');19| // Statamic::style('app', 'cp');20|
> 21| Generator::after(function () {
22| // eg. copy directory to some server23| });
24| }
Exception trace:
1Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Non-static method Statamic\StaticSite\Generator::after() should not be called statically", "/.../app/Providers/AppServiceProvider.php", [])
/.../app/Providers/AppServiceProvider.php:212App\Providers\AppServiceProvider::boot()
/.../vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
The text was updated successfully, but these errors were encountered:
It seems to work fine if you use it as a real-time facade though:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Statamic\Statamic;
use Statamic\StaticSite\Generator;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(Generator $ssg)
{
// Statamic::script('app', 'cp');
// Statamic::style('app', 'cp');
$ssg->after(function() {
// eg. copy directory to some server
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
I tried adding the post generator function to my AppServiceProvider as the documentation suggests but I ran into an issue:
The text was updated successfully, but these errors were encountered: