generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: initial support for Filament v3 (#83)
Co-authored-by: ryangjchandler <ryangjchandler@users.noreply.github.com>
- Loading branch information
1 parent
9f757ee
commit 74b7c80
Showing
19 changed files
with
322 additions
and
6,453 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Upgrade Guide | ||
|
||
## Upgrading from v0.x to v1.0 | ||
|
||
Starting with version v1.0, this package now only supports Filament v3.x. | ||
|
||
Follow these steps to update the package for Filament v3.x. | ||
|
||
1. Update the package version in your `composer.json`. | ||
2. Run `composer update`. | ||
3. Register the plugin inside of your project's `PanelProvider`. | ||
|
||
```php | ||
use RyanChandler\FilamentNavigation\FilamentNavigation; | ||
|
||
public function panel(Panel $panel): Panel | ||
{ | ||
return $panel | ||
->plugin(FilamentNavigation::make()) | ||
// ... | ||
} | ||
``` | ||
|
||
4. Publish the plugin assets. | ||
|
||
```sh | ||
php artisan filament:assets | ||
``` | ||
|
||
5. Open your panel and check that the resource has been registered and existing navigation menus are showing. | ||
|
||
If you have registered custom navigation item types, the `addItemType()` method no longer exists. | ||
|
||
Instead, register the item types on the `FilamentNavigation` plugin object directly. | ||
|
||
```php | ||
return $panel | ||
->plugin( | ||
FilamentNavigation::make() | ||
->itemType('post', [ | ||
Select::make('post_id') | ||
->//... | ||
]) | ||
) | ||
// ... | ||
``` | ||
|
||
If you previously used the configuration file to change the `navigation_model` or `navigation_resource` values, those no longer exist and need to be updated to method calls on the plugin object. | ||
|
||
```php | ||
return $panel | ||
->plugin( | ||
FilamentNavigation::make() | ||
->usingResource(MyNavigationResource::class) | ||
->usingModel(MyNavigationModel::class) | ||
) | ||
// ... | ||
``` | ||
|
||
If you have any issues with the upgrade, please open an issue and provide details. Reproduction repositories are much appreciated. |
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 |
---|---|---|
@@ -1,39 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
executionOrder="random" | ||
failOnWarning="true" | ||
failOnRisky="true" | ||
failOnEmptyTestSuite="true" | ||
beStrictAboutOutputDuringTests="true" | ||
verbose="true" | ||
> | ||
<testsuites> | ||
<testsuite name="RyanChandler Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
<report> | ||
<html outputDirectory="build/coverage"/> | ||
<text outputFile="build/coverage.txt"/> | ||
<clover outputFile="build/logs/clover.xml"/> | ||
</report> | ||
</coverage> | ||
<logging> | ||
<junit outputFile="build/report.junit.xml"/> | ||
</logging> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false"> | ||
<testsuites> | ||
<testsuite name="RyanChandler Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage> | ||
<report> | ||
<html outputDirectory="build/coverage"/> | ||
<text outputFile="build/coverage.txt"/> | ||
<clover outputFile="build/logs/clover.xml"/> | ||
</report> | ||
</coverage> | ||
<logging> | ||
<junit outputFile="build/report.junit.xml"/> | ||
</logging> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
Oops, something went wrong.