├── README.md ├── src ├── Contracts │ └── OverridableModel.php └── Traits │ └── Overridable.php ├── .gitignore ├── phpcs.xml ├── composer.json ├── LICENSE └── composer.lock /README.md: -------------------------------------------------------------------------------- 1 | # laravel-overridable-model 2 | Provide a uniform method of allowing models to be overridden in Laravel. 3 | 4 | ## Installation 5 | ```sh 6 | composer require genealabs/laravel-overridable-model 7 | ``` 8 | 9 | ## Usage 10 | ### Contract 11 | 12 | ### Trait 13 | -------------------------------------------------------------------------------- /src/Contracts/OverridableModel.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | GeneaLabs coding standards. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "genealabs/laravel-overridable-model", 3 | "description": "Provide a uniform method of allowing models to be overridden in Laravel.", 4 | "keywords": [ 5 | "laravel", 6 | "nova" 7 | ], 8 | "license": "MIT", 9 | "require": { 10 | "illuminate/support": "^10.0|^11.0", 11 | "symfony/thanks": "^1.2" 12 | }, 13 | "autoload": { 14 | "psr-4": { 15 | "GeneaLabs\\LaravelOverridableModel\\": "src/" 16 | } 17 | }, 18 | "config": { 19 | "sort-packages": true 20 | }, 21 | "minimum-stability": "dev", 22 | "prefer-stable": true 23 | } 24 | -------------------------------------------------------------------------------- /src/Traits/Overridable.php: -------------------------------------------------------------------------------- 1 | =5.3.0" 401 | }, 402 | "type": "library", 403 | "extra": { 404 | "branch-alias": { 405 | "dev-master": "1.0.x-dev" 406 | } 407 | }, 408 | "autoload": { 409 | "psr-4": { 410 | "Psr\\Container\\": "src/" 411 | } 412 | }, 413 | "notification-url": "https://packagist.org/downloads/", 414 | "license": [ 415 | "MIT" 416 | ], 417 | "authors": [ 418 | { 419 | "name": "PHP-FIG", 420 | "homepage": "http://www.php-fig.org/" 421 | } 422 | ], 423 | "description": "Common Container Interface (PHP FIG PSR-11)", 424 | "homepage": "https://github.com/php-fig/container", 425 | "keywords": [ 426 | "PSR-11", 427 | "container", 428 | "container-interface", 429 | "container-interop", 430 | "psr" 431 | ], 432 | "time": "2017-02-14T16:28:37+00:00" 433 | }, 434 | { 435 | "name": "psr/simple-cache", 436 | "version": "1.0.1", 437 | "source": { 438 | "type": "git", 439 | "url": "https://github.com/php-fig/simple-cache.git", 440 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" 441 | }, 442 | "dist": { 443 | "type": "zip", 444 | "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 445 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 446 | "shasum": "" 447 | }, 448 | "require": { 449 | "php": ">=5.3.0" 450 | }, 451 | "type": "library", 452 | "extra": { 453 | "branch-alias": { 454 | "dev-master": "1.0.x-dev" 455 | } 456 | }, 457 | "autoload": { 458 | "psr-4": { 459 | "Psr\\SimpleCache\\": "src/" 460 | } 461 | }, 462 | "notification-url": "https://packagist.org/downloads/", 463 | "license": [ 464 | "MIT" 465 | ], 466 | "authors": [ 467 | { 468 | "name": "PHP-FIG", 469 | "homepage": "http://www.php-fig.org/" 470 | } 471 | ], 472 | "description": "Common interfaces for simple caching", 473 | "keywords": [ 474 | "cache", 475 | "caching", 476 | "psr", 477 | "psr-16", 478 | "simple-cache" 479 | ], 480 | "time": "2017-10-23T01:57:42+00:00" 481 | }, 482 | { 483 | "name": "symfony/polyfill-mbstring", 484 | "version": "v1.18.1", 485 | "source": { 486 | "type": "git", 487 | "url": "https://github.com/symfony/polyfill-mbstring.git", 488 | "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" 489 | }, 490 | "dist": { 491 | "type": "zip", 492 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", 493 | "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", 494 | "shasum": "" 495 | }, 496 | "require": { 497 | "php": ">=5.3.3" 498 | }, 499 | "suggest": { 500 | "ext-mbstring": "For best performance" 501 | }, 502 | "type": "library", 503 | "extra": { 504 | "branch-alias": { 505 | "dev-master": "1.18-dev" 506 | }, 507 | "thanks": { 508 | "name": "symfony/polyfill", 509 | "url": "https://github.com/symfony/polyfill" 510 | } 511 | }, 512 | "autoload": { 513 | "psr-4": { 514 | "Symfony\\Polyfill\\Mbstring\\": "" 515 | }, 516 | "files": [ 517 | "bootstrap.php" 518 | ] 519 | }, 520 | "notification-url": "https://packagist.org/downloads/", 521 | "license": [ 522 | "MIT" 523 | ], 524 | "authors": [ 525 | { 526 | "name": "Nicolas Grekas", 527 | "email": "p@tchwork.com" 528 | }, 529 | { 530 | "name": "Symfony Community", 531 | "homepage": "https://symfony.com/contributors" 532 | } 533 | ], 534 | "description": "Symfony polyfill for the Mbstring extension", 535 | "homepage": "https://symfony.com", 536 | "keywords": [ 537 | "compatibility", 538 | "mbstring", 539 | "polyfill", 540 | "portable", 541 | "shim" 542 | ], 543 | "funding": [ 544 | { 545 | "url": "https://symfony.com/sponsor", 546 | "type": "custom" 547 | }, 548 | { 549 | "url": "https://github.com/fabpot", 550 | "type": "github" 551 | }, 552 | { 553 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 554 | "type": "tidelift" 555 | } 556 | ], 557 | "time": "2020-07-14T12:35:20+00:00" 558 | }, 559 | { 560 | "name": "symfony/polyfill-php80", 561 | "version": "v1.18.1", 562 | "source": { 563 | "type": "git", 564 | "url": "https://github.com/symfony/polyfill-php80.git", 565 | "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" 566 | }, 567 | "dist": { 568 | "type": "zip", 569 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", 570 | "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", 571 | "shasum": "" 572 | }, 573 | "require": { 574 | "php": ">=7.0.8" 575 | }, 576 | "type": "library", 577 | "extra": { 578 | "branch-alias": { 579 | "dev-master": "1.18-dev" 580 | }, 581 | "thanks": { 582 | "name": "symfony/polyfill", 583 | "url": "https://github.com/symfony/polyfill" 584 | } 585 | }, 586 | "autoload": { 587 | "psr-4": { 588 | "Symfony\\Polyfill\\Php80\\": "" 589 | }, 590 | "files": [ 591 | "bootstrap.php" 592 | ], 593 | "classmap": [ 594 | "Resources/stubs" 595 | ] 596 | }, 597 | "notification-url": "https://packagist.org/downloads/", 598 | "license": [ 599 | "MIT" 600 | ], 601 | "authors": [ 602 | { 603 | "name": "Ion Bazan", 604 | "email": "ion.bazan@gmail.com" 605 | }, 606 | { 607 | "name": "Nicolas Grekas", 608 | "email": "p@tchwork.com" 609 | }, 610 | { 611 | "name": "Symfony Community", 612 | "homepage": "https://symfony.com/contributors" 613 | } 614 | ], 615 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 616 | "homepage": "https://symfony.com", 617 | "keywords": [ 618 | "compatibility", 619 | "polyfill", 620 | "portable", 621 | "shim" 622 | ], 623 | "funding": [ 624 | { 625 | "url": "https://symfony.com/sponsor", 626 | "type": "custom" 627 | }, 628 | { 629 | "url": "https://github.com/fabpot", 630 | "type": "github" 631 | }, 632 | { 633 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 634 | "type": "tidelift" 635 | } 636 | ], 637 | "time": "2020-07-14T12:35:20+00:00" 638 | }, 639 | { 640 | "name": "symfony/thanks", 641 | "version": "v1.2.9", 642 | "source": { 643 | "type": "git", 644 | "url": "https://github.com/symfony/thanks.git", 645 | "reference": "733cc7b8c09a06c9251bd35d772b453b47d98442" 646 | }, 647 | "dist": { 648 | "type": "zip", 649 | "url": "https://api.github.com/repos/symfony/thanks/zipball/733cc7b8c09a06c9251bd35d772b453b47d98442", 650 | "reference": "733cc7b8c09a06c9251bd35d772b453b47d98442", 651 | "shasum": "" 652 | }, 653 | "require": { 654 | "composer-plugin-api": "^1.0|^2.0", 655 | "php": "^5.5.9|^7.0.0" 656 | }, 657 | "type": "composer-plugin", 658 | "extra": { 659 | "branch-alias": { 660 | "dev-master": "1.2-dev" 661 | }, 662 | "class": "Symfony\\Thanks\\Thanks" 663 | }, 664 | "autoload": { 665 | "psr-4": { 666 | "Symfony\\Thanks\\": "src" 667 | } 668 | }, 669 | "notification-url": "https://packagist.org/downloads/", 670 | "license": [ 671 | "MIT" 672 | ], 673 | "authors": [ 674 | { 675 | "name": "Nicolas Grekas", 676 | "email": "p@tchwork.com" 677 | } 678 | ], 679 | "description": "Encourages sending ⭐ and 💵 to fellow PHP package maintainers (not limited to Symfony components)!", 680 | "funding": [ 681 | { 682 | "url": "https://symfony.com/sponsor", 683 | "type": "custom" 684 | }, 685 | { 686 | "url": "https://github.com/fabpot", 687 | "type": "github" 688 | }, 689 | { 690 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 691 | "type": "tidelift" 692 | } 693 | ], 694 | "time": "2020-06-23T10:36:34+00:00" 695 | }, 696 | { 697 | "name": "symfony/translation", 698 | "version": "v5.1.5", 699 | "source": { 700 | "type": "git", 701 | "url": "https://github.com/symfony/translation.git", 702 | "reference": "917b02cdc5f33e0309b8e9d33ee1480b20687413" 703 | }, 704 | "dist": { 705 | "type": "zip", 706 | "url": "https://api.github.com/repos/symfony/translation/zipball/917b02cdc5f33e0309b8e9d33ee1480b20687413", 707 | "reference": "917b02cdc5f33e0309b8e9d33ee1480b20687413", 708 | "shasum": "" 709 | }, 710 | "require": { 711 | "php": ">=7.2.5", 712 | "symfony/polyfill-mbstring": "~1.0", 713 | "symfony/polyfill-php80": "^1.15", 714 | "symfony/translation-contracts": "^2" 715 | }, 716 | "conflict": { 717 | "symfony/config": "<4.4", 718 | "symfony/dependency-injection": "<5.0", 719 | "symfony/http-kernel": "<5.0", 720 | "symfony/twig-bundle": "<5.0", 721 | "symfony/yaml": "<4.4" 722 | }, 723 | "provide": { 724 | "symfony/translation-implementation": "2.0" 725 | }, 726 | "require-dev": { 727 | "psr/log": "~1.0", 728 | "symfony/config": "^4.4|^5.0", 729 | "symfony/console": "^4.4|^5.0", 730 | "symfony/dependency-injection": "^5.0", 731 | "symfony/finder": "^4.4|^5.0", 732 | "symfony/http-kernel": "^5.0", 733 | "symfony/intl": "^4.4|^5.0", 734 | "symfony/service-contracts": "^1.1.2|^2", 735 | "symfony/yaml": "^4.4|^5.0" 736 | }, 737 | "suggest": { 738 | "psr/log-implementation": "To use logging capability in translator", 739 | "symfony/config": "", 740 | "symfony/yaml": "" 741 | }, 742 | "type": "library", 743 | "extra": { 744 | "branch-alias": { 745 | "dev-master": "5.1-dev" 746 | } 747 | }, 748 | "autoload": { 749 | "psr-4": { 750 | "Symfony\\Component\\Translation\\": "" 751 | }, 752 | "exclude-from-classmap": [ 753 | "/Tests/" 754 | ] 755 | }, 756 | "notification-url": "https://packagist.org/downloads/", 757 | "license": [ 758 | "MIT" 759 | ], 760 | "authors": [ 761 | { 762 | "name": "Fabien Potencier", 763 | "email": "fabien@symfony.com" 764 | }, 765 | { 766 | "name": "Symfony Community", 767 | "homepage": "https://symfony.com/contributors" 768 | } 769 | ], 770 | "description": "Symfony Translation Component", 771 | "homepage": "https://symfony.com", 772 | "funding": [ 773 | { 774 | "url": "https://symfony.com/sponsor", 775 | "type": "custom" 776 | }, 777 | { 778 | "url": "https://github.com/fabpot", 779 | "type": "github" 780 | }, 781 | { 782 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 783 | "type": "tidelift" 784 | } 785 | ], 786 | "time": "2020-08-17T10:01:29+00:00" 787 | }, 788 | { 789 | "name": "symfony/translation-contracts", 790 | "version": "v2.2.0", 791 | "source": { 792 | "type": "git", 793 | "url": "https://github.com/symfony/translation-contracts.git", 794 | "reference": "77ce1c3627c9f39643acd9af086631f842c50c4d" 795 | }, 796 | "dist": { 797 | "type": "zip", 798 | "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/77ce1c3627c9f39643acd9af086631f842c50c4d", 799 | "reference": "77ce1c3627c9f39643acd9af086631f842c50c4d", 800 | "shasum": "" 801 | }, 802 | "require": { 803 | "php": ">=7.2.5" 804 | }, 805 | "suggest": { 806 | "symfony/translation-implementation": "" 807 | }, 808 | "type": "library", 809 | "extra": { 810 | "branch-alias": { 811 | "dev-master": "2.2-dev" 812 | }, 813 | "thanks": { 814 | "name": "symfony/contracts", 815 | "url": "https://github.com/symfony/contracts" 816 | } 817 | }, 818 | "autoload": { 819 | "psr-4": { 820 | "Symfony\\Contracts\\Translation\\": "" 821 | } 822 | }, 823 | "notification-url": "https://packagist.org/downloads/", 824 | "license": [ 825 | "MIT" 826 | ], 827 | "authors": [ 828 | { 829 | "name": "Nicolas Grekas", 830 | "email": "p@tchwork.com" 831 | }, 832 | { 833 | "name": "Symfony Community", 834 | "homepage": "https://symfony.com/contributors" 835 | } 836 | ], 837 | "description": "Generic abstractions related to translation", 838 | "homepage": "https://symfony.com", 839 | "keywords": [ 840 | "abstractions", 841 | "contracts", 842 | "decoupling", 843 | "interfaces", 844 | "interoperability", 845 | "standards" 846 | ], 847 | "funding": [ 848 | { 849 | "url": "https://symfony.com/sponsor", 850 | "type": "custom" 851 | }, 852 | { 853 | "url": "https://github.com/fabpot", 854 | "type": "github" 855 | }, 856 | { 857 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 858 | "type": "tidelift" 859 | } 860 | ], 861 | "time": "2020-09-07T11:33:47+00:00" 862 | }, 863 | { 864 | "name": "voku/portable-ascii", 865 | "version": "1.5.3", 866 | "source": { 867 | "type": "git", 868 | "url": "https://github.com/voku/portable-ascii.git", 869 | "reference": "25bcbf01678930251fd572891447d9e318a6e2b8" 870 | }, 871 | "dist": { 872 | "type": "zip", 873 | "url": "https://api.github.com/repos/voku/portable-ascii/zipball/25bcbf01678930251fd572891447d9e318a6e2b8", 874 | "reference": "25bcbf01678930251fd572891447d9e318a6e2b8", 875 | "shasum": "" 876 | }, 877 | "require": { 878 | "php": ">=7.0.0" 879 | }, 880 | "require-dev": { 881 | "phpunit/phpunit": "~6.0 || ~7.0" 882 | }, 883 | "suggest": { 884 | "ext-intl": "Use Intl for transliterator_transliterate() support" 885 | }, 886 | "type": "library", 887 | "autoload": { 888 | "psr-4": { 889 | "voku\\": "src/voku/" 890 | } 891 | }, 892 | "notification-url": "https://packagist.org/downloads/", 893 | "license": [ 894 | "MIT" 895 | ], 896 | "authors": [ 897 | { 898 | "name": "Lars Moelleken", 899 | "homepage": "http://www.moelleken.org/" 900 | } 901 | ], 902 | "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", 903 | "homepage": "https://github.com/voku/portable-ascii", 904 | "keywords": [ 905 | "ascii", 906 | "clean", 907 | "php" 908 | ], 909 | "funding": [ 910 | { 911 | "url": "https://www.paypal.me/moelleken", 912 | "type": "custom" 913 | }, 914 | { 915 | "url": "https://github.com/voku", 916 | "type": "github" 917 | }, 918 | { 919 | "url": "https://opencollective.com/portable-ascii", 920 | "type": "open_collective" 921 | }, 922 | { 923 | "url": "https://www.patreon.com/voku", 924 | "type": "patreon" 925 | }, 926 | { 927 | "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", 928 | "type": "tidelift" 929 | } 930 | ], 931 | "time": "2020-07-22T23:32:04+00:00" 932 | } 933 | ], 934 | "packages-dev": [], 935 | "aliases": [], 936 | "minimum-stability": "dev", 937 | "stability-flags": [], 938 | "prefer-stable": true, 939 | "prefer-lowest": false, 940 | "platform": [], 941 | "platform-dev": [], 942 | "plugin-api-version": "1.1.0" 943 | } 944 | --------------------------------------------------------------------------------