99 * @property string $author
1010 * @property string $name
1111 * @property string|null $description
12+ * @property array|null $features
1213 * @property string $docker_image
1314 * @property string|null $config_files
1415 * @property string|null $config_startup
3132 * @property string|null $inherit_config_startup
3233 * @property string|null $inherit_config_logs
3334 * @property string|null $inherit_config_stop
35+ * @property array|null $inherit_features
3436 *
3537 * @property \Pterodactyl\Models\Nest $nest
3638 * @property \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\Server[] $servers
@@ -46,6 +48,18 @@ class Egg extends Model
4648 */
4749 const RESOURCE_NAME = 'egg ' ;
4850
51+ /**
52+ * Different features that can be enabled on any given egg. These are used internally
53+ * to determine which types of frontend functionality should be shown to the user. Eggs
54+ * will automatically inherit features from a parent egg if they are already configured
55+ * to copy configuration values from said egg.
56+ *
57+ * To skip copying the features, an empty array value should be passed in ("[]") rather
58+ * than leaving it null.
59+ */
60+ const FEATURE_EULA_POPUP = 'eula ' ;
61+ const FEATURE_FASTDL = 'fastdl ' ;
62+
4963 /**
5064 * The table associated with the model.
5165 *
@@ -61,6 +75,7 @@ class Egg extends Model
6175 protected $ fillable = [
6276 'name ' ,
6377 'description ' ,
78+ 'features ' ,
6479 'docker_image ' ,
6580 'config_files ' ,
6681 'config_startup ' ,
@@ -85,6 +100,7 @@ class Egg extends Model
85100 'config_from ' => 'integer ' ,
86101 'script_is_privileged ' => 'boolean ' ,
87102 'copy_script_from ' => 'integer ' ,
103+ 'features ' => 'array ' ,
88104 ];
89105
90106 /**
@@ -95,6 +111,7 @@ class Egg extends Model
95111 'uuid ' => 'required|string|size:36 ' ,
96112 'name ' => 'required|string|max:191 ' ,
97113 'description ' => 'string|nullable ' ,
114+ 'features ' => 'json|nullable ' ,
98115 'author ' => 'required|string|email ' ,
99116 'docker_image ' => 'required|string|max:191 ' ,
100117 'startup ' => 'required|nullable|string ' ,
@@ -109,6 +126,7 @@ class Egg extends Model
109126 * @var array
110127 */
111128 protected $ attributes = [
129+ 'features ' => null ,
112130 'config_stop ' => null ,
113131 'config_startup ' => null ,
114132 'config_logs ' => null ,
@@ -216,6 +234,21 @@ public function getInheritConfigStopAttribute()
216234 return $ this ->configFrom ->config_stop ;
217235 }
218236
237+ /**
238+ * Returns the features available to this egg from the parent configuration if there are
239+ * no features defined for this egg specifically and there is a parent egg configured.
240+ *
241+ * @return array|null
242+ */
243+ public function getInheritFeaturesAttribute ()
244+ {
245+ if (! is_null ($ this ->features ) || is_null ($ this ->config_from )) {
246+ return $ this ->features ;
247+ }
248+
249+ return $ this ->configFrom ->features ;
250+ }
251+
219252 /**
220253 * Gets nest associated with an egg.
221254 *
0 commit comments