├── composer.json └── src ├── Auth ├── Command │ ├── AuthenticateUser.php │ ├── DeauthenticateUser.php │ ├── PasswordBroker.php │ └── ThrottlesLogins.php ├── Guard.php └── Listener │ ├── AuthenticateUser.php │ ├── DeauthenticateUser.php │ ├── PasswordReset.php │ ├── PasswordResetLink.php │ └── ThrottlesLogins.php ├── Authorization ├── Authorizable.php ├── Authorization.php └── Factory.php ├── Config └── PackageRepository.php ├── Extension ├── Command │ ├── Activator.php │ ├── Configure.php │ ├── Deactivator.php │ ├── Migrator.php │ └── Viewer.php ├── Dispatcher.php ├── Factory.php ├── Finder.php ├── Listener │ ├── Activator.php │ ├── Configure.php │ ├── Deactivator.php │ ├── Extension.php │ ├── Migrator.php │ └── Viewer.php ├── StatusChecker.php └── UrlGenerator.php ├── Foundation ├── Application.php ├── Command │ ├── Account │ │ ├── PasswordUpdater.php │ │ ├── ProfileCreator.php │ │ ├── ProfileDashboard.php │ │ ├── ProfileUpdater.php │ │ ├── UserCreator.php │ │ ├── UserRemover.php │ │ ├── UserUpdater.php │ │ └── UserViewer.php │ ├── AssetPublisher.php │ ├── ResourceLoader.php │ ├── SettingUpdater.php │ └── SystemUpdater.php ├── Foundation.php └── Listener │ ├── Account │ ├── PasswordUpdater.php │ ├── ProfileCreator.php │ ├── ProfileDashboard.php │ ├── ProfileUpdater.php │ ├── User.php │ ├── UserCreator.php │ ├── UserRemover.php │ ├── UserUpdater.php │ └── UserViewer.php │ ├── AssetPublishing.php │ ├── ResourceLoader.php │ ├── SettingUpdater.php │ └── SystemUpdater.php ├── Html ├── Builder.php ├── Factory.php ├── Form │ ├── Builder.php │ ├── Control.php │ ├── Factory.php │ ├── Field.php │ ├── Fieldset.php │ ├── Grid.php │ ├── Presenter.php │ └── Template.php ├── Grid.php └── Table │ ├── Builder.php │ ├── Column.php │ ├── Factory.php │ └── Grid.php ├── Http └── RouteManager.php ├── Installation ├── Installation.php ├── Requirement.php └── Specification.php ├── Memory ├── Handler.php └── Provider.php ├── Messages └── MessageBag.php ├── Notification ├── Message.php ├── Notification.php ├── Receipt.php └── Recipient.php ├── Publisher ├── FilePermissionException.php ├── Publisher.php ├── ServerException.php └── Uploader.php ├── Support ├── DataContainer.php ├── ManifestRuntimeException.php └── Transformable.php └── Theme ├── Finder.php ├── Listener └── Selector.php └── Theme.php /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orchestra/contracts", 3 | "description": "Contracts for Orchestra Platform", 4 | "keywords": ["orchestra-platform", "orchestral", "contracts"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Mior Muhammad Zaki", 9 | "email": "crynobone@gmail.com", 10 | "homepage": "https://github.com/crynobone" 11 | } 12 | ], 13 | "autoload": { 14 | "psr-4": { 15 | "Orchestra\\Contracts\\": "src/" 16 | } 17 | }, 18 | "require": { 19 | "php": "^8.0", 20 | "illuminate/contracts": "^9.0" 21 | }, 22 | "extra": { 23 | "branch-alias": { 24 | "dev-master": "7.0-dev" 25 | } 26 | }, 27 | "minimum-stability": "dev" 28 | } 29 | -------------------------------------------------------------------------------- /src/Auth/Command/AuthenticateUser.php: -------------------------------------------------------------------------------- 1 | 11 | * // add a new control using just field name 12 | * $fieldset->control('input:text', 'username'); 13 | * 14 | * // add a new control using a label (header title) and field name 15 | * $fieldset->control('input:email', 'E-mail Address', 'email'); 16 | * 17 | * // add a new control by using a field name and closure 18 | * $fieldset->control('input:text', 'fullname', function ($control) 19 | * { 20 | * $control->label = 'User Name'; 21 | * 22 | * // this would output a read-only output instead of form. 23 | * $control->field = function ($row) { 24 | * return $row->first_name.' '.$row->last_name; 25 | * }; 26 | * }); 27 | * 28 | * 29 | * @param string $type 30 | * @param mixed $name 31 | * @param mixed $callback 32 | * 33 | * @return \Orchestra\Contracts\Html\Form\Field 34 | */ 35 | public function control($type, $name, $callback = null); 36 | 37 | /** 38 | * Set Fieldset Legend name. 39 | * 40 | * 41 | * $fieldset->legend('User Information'); 42 | * 43 | * 44 | * @param string $name 45 | * 46 | * @return mixed 47 | */ 48 | public function legend($name = null); 49 | 50 | /** 51 | * Get fieldset name. 52 | * 53 | * @return string 54 | */ 55 | public function getName(); 56 | } 57 | -------------------------------------------------------------------------------- /src/Html/Form/Grid.php: -------------------------------------------------------------------------------- 1 | 15 | * // assign a data 16 | * $form->with(DB::table('users')->get()); 17 | * 18 | * 19 | * @param array|\stdClass|\Illuminate\Database\Eloquent\Model|null $data 20 | * 21 | * @return $this 22 | */ 23 | public function with($data); 24 | 25 | /** 26 | * Get raw data. 27 | * 28 | * @return mixed 29 | */ 30 | public function data(); 31 | 32 | /** 33 | * Create a new Fieldset instance. 34 | * 35 | * @param string|\Closure $name 36 | */ 37 | public function fieldset($name, Closure $callback = null): Fieldset; 38 | 39 | /** 40 | * Add hidden field. 41 | * 42 | * @param \Closure|null $callback 43 | */ 44 | public function hidden(string $name, $callback = null): void; 45 | 46 | /** 47 | * Setup form configuration. 48 | * @param string $url 49 | * 50 | * @return $this 51 | */ 52 | public function resource(Presenter $listener, $url, Model $model, array $attributes = []); 53 | 54 | /** 55 | * Setup simple form configuration. 56 | * 57 | * @param string $url 58 | * @param \Illuminate\Database\Eloquent\Model $model 59 | * 60 | * @return $this 61 | */ 62 | public function setup(Presenter $listener, $url, $model, array $attributes = []); 63 | } 64 | -------------------------------------------------------------------------------- /src/Html/Form/Presenter.php: -------------------------------------------------------------------------------- 1 | 21 | * // use default horizontal layout 22 | * $fieldset->layout('horizontal'); 23 | * 24 | * // use default vertical layout 25 | * $fieldset->layout('vertical'); 26 | * 27 | * // define fieldset using custom view 28 | * $fieldset->layout('path.to.view'); 29 | * 30 | * 31 | * @return $this 32 | */ 33 | public function layout(string $name, array $data = []); 34 | 35 | /** 36 | * Allow column overwriting. 37 | * 38 | * @param mixed|null $callback 39 | * 40 | * @throws \InvalidArgumentException 41 | * @throws \RuntimeException 42 | * 43 | * @return \Illuminate\Support\Fluent 44 | */ 45 | public function of(string $name, $callback = null); 46 | 47 | /** 48 | * Forget meta value. 49 | */ 50 | public function forget(string $key): void; 51 | 52 | /** 53 | * Get meta value. 54 | * 55 | * @param mixed|null $default 56 | * 57 | * @return mixed 58 | */ 59 | public function get(string $key, $default = null); 60 | 61 | /** 62 | * Set meta value. 63 | * 64 | * @param mixed $value 65 | * 66 | * @return array 67 | */ 68 | public function set(string $key, $value); 69 | } 70 | -------------------------------------------------------------------------------- /src/Html/Table/Builder.php: -------------------------------------------------------------------------------- 1 | 14 | * // add model without pagination 15 | * $table->with(User::all(), false); 16 | * 17 | * // add model with pagination 18 | * $table->with(User::paginate(30), true); 19 | * 20 | * 21 | * @param mixed $model 22 | * 23 | * @throws \InvalidArgumentException 24 | * 25 | * @return $this 26 | */ 27 | public function with($model, bool $paginate = true); 28 | 29 | /** 30 | * Attach rows data instead of assigning a model. 31 | * 32 | * 33 | * // assign a data 34 | * $table->rows(DB::table('users')->get()); 35 | * 36 | * 37 | * @param array|\Illuminate\Contracts\Support\Arrayable $data 38 | * 39 | * @throws \InvalidArgumentException 40 | * 41 | * @return $this 42 | */ 43 | public function rows($data); 44 | 45 | /** 46 | * Get raw data. 47 | * 48 | * @throws \InvalidArgumentException 49 | */ 50 | public function data(): array; 51 | 52 | /** 53 | * Add or append grid header attributes. 54 | * 55 | * @return \Closure|array|null 56 | */ 57 | public function header(Closure $callback = null); 58 | 59 | /** 60 | * Append a new column to the table. 61 | * 62 | * 63 | * // add a new column using just field name 64 | * $table->column('username'); 65 | * 66 | * // add a new column using a label (header title) and field name 67 | * $table->column('User Name', 'username'); 68 | * 69 | * // add a new column by using a field name and closure 70 | * $table->column('fullname', function ($column) 71 | * { 72 | * $column->label = 'User Name'; 73 | * $column->value = function ($row) { 74 | * return $row->first_name.' '.$row->last_name; 75 | * }; 76 | * 77 | * $column->attributes(function ($row) { 78 | * return array('data-id' => $row->id); 79 | * }); 80 | * }); 81 | * 82 | * 83 | * @param mixed $name 84 | * @param mixed|null $callback 85 | * 86 | * @return \Orchestra\Contracts\Html\Table\Column 87 | */ 88 | public function column($name, $callback = null); 89 | 90 | /** 91 | * Setup pagination. 92 | * 93 | * @param int|null $perPage 94 | * 95 | * @return $this 96 | */ 97 | public function paginate($perPage); 98 | 99 | /** 100 | * Get whether current setup is paginated. 101 | */ 102 | public function paginated(): bool; 103 | 104 | /** 105 | * Execute searchable filter on model instance. 106 | */ 107 | public function searchable(array $columns, string $searchKey = 'q'): void; 108 | 109 | /** 110 | * Execute sortable query filter on model instance. 111 | */ 112 | public function sortable( 113 | array $config = [], 114 | string $orderByKey = 'order_by', 115 | string $directionKey = 'direction' 116 | ): void; 117 | } 118 | -------------------------------------------------------------------------------- /src/Http/RouteManager.php: -------------------------------------------------------------------------------- 1 |