-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Rapidez Statamic | ||
|
||
## Requirements | ||
|
||
You have to have `statamic/cms` installed in your laravel application. Installation guide is found [here](https://statamic.dev/installing/laravel). | ||
|
||
## Installation | ||
|
||
``` | ||
composer require rapidez/statamic | ||
``` | ||
|
||
### Routing | ||
|
||
As Rapidez uses route fallbacks to allow routes to be added with lower priority then Magento routes, this package is used to fix this, as statamic routes on itself will overwrite your Magento routes. Make sure default Statamic routing is disabled in `config/statamic/routes.php`: | ||
|
||
```php | ||
|
||
'enabled' => false, | ||
|
||
``` | ||
|
||
## License | ||
|
||
GNU General Public License v3. Please see [License File](LICENSE) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "rapidez/statamic", | ||
"description": "Rapidez Statamic", | ||
"keywords": [ | ||
"rapidez", | ||
"statamic" | ||
], | ||
"homepage": "https://rapidez.io", | ||
"license": "GPL-3.0", | ||
"authors": [ | ||
{ | ||
"name": "Bob Wezelman", | ||
"email": "bob@justbetter.nl", | ||
"homepage": "https://justbetter.nl", | ||
"role": "Developer" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"require": { | ||
"php": "^8.0|^8.1", | ||
"statamic/cms": "^3.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Rapidez\\Statamic\\": "src" | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"pixelfear/composer-dist-plugin": true | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Rapidez\\Statamic\\RapidezStatamicServiceProvider" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use Statamic\Facades\Data; | ||
|
||
if ($entry = Data::findByRequestUrl(request()->url())) { | ||
if (View::exists($entry->get('template'))) { | ||
echo view($entry->get('template'), $entry->data()); | ||
} else if (View::exists(str($entry->structure()->handle())->singular()->toString())) { | ||
echo view(str($entry->structure()->handle())->singular()->toString(), $entry->data()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Rapidez\Statamic; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use TorMorten\Eventy\Facades\Eventy; | ||
|
||
class RapidezStatamicServiceProvider extends ServiceProvider | ||
{ | ||
public function boot() | ||
{ | ||
Eventy::addFilter('routes', fn ($routes) => array_merge($routes ?: [], [__DIR__.'/../routes/fallback.php'])); | ||
} | ||
} |