naoray / blueprint-nova-addon Goto Github PK
View Code? Open in Web Editor NEWA Blueprint addon which generates Nova resources
License: MIT License
A Blueprint addon which generates Nova resources
License: MIT License
composer require --dev naoray/blueprint-nova-addon
Using version ^2.0 for naoray/blueprint-nova-addon
./composer.json has been updated
Running composer update naoray/blueprint-nova-addon
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires naoray/blueprint-nova-addon ^2.0 -> satisfiable by naoray/blueprint-nova-addon[v2.0.0].
- naoray/blueprint-nova-addon v2.0.0 requires illuminate/pipeline ^6.0 || ^7.0 || ^8.0 -> found illuminate/pipeline[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require naoray/blueprint-nova-addon:*" to figure out if any version is installable, or "composer require naoray/blueprint-nova-addon:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I have a request. Would it have a way to publish the stubs for customization?
I think there are an issue on generate class
Declaration of Naoray\BlueprintNovaAddon\NovaGenerator::output(array $tree): array must be compatible with Blueprint\Contracts\Generator::output(Blueprint\Tree $tree): array
I edit output function to
public function output(Tree $tree): array
{
.....
foreach ($tree->models as $model) {
.....
}
return $output;
}
And now working fine.
Currently only BelongsTo
, BelongsToMany
, HasOne
and HasMany
relationship Fields are generated - source.
MorphTo
, MorhpOne
, MorphMany
) - (blueprint source)->nullable()
method callto BelongsTo
relation fields when the $column->modifiers()
contains nullable
When running composer require naoray/blueprint-nova-addon I get the following error
_Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires naoray/blueprint-nova-addon ^2.0 -> satisfiable by naoray/blueprint-nova-addon[v2.0.0].
- naoray/blueprint-nova-addon v2.0.0 requires illuminate/pipeline ^6.0 || ^7.0 || ^8.0 -> found illuminate/pipeline[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require naoray/blueprint-nova-addon:*" to figure out if any version is installable, or "composer require naoray/blueprint-nova-addon:^2.1" if you know which you need._
I'm guessing this is related to new PHP, Laravel, Or Nova. Do you have any plans to update the code?
Unable to use Blueprint Id
shorthand with this package.
models:
Vat:
Id
uuid: uuid
Error:
ErrorException
Undefined array key ""
at vendor/naoray/blueprint-nova-addon/src/Tasks/AddIdentifierField.php:36
32▕ // filter out all relationships
33▕ ->diff(Arr::get($model->relationships(), 'belongsTo', []))
34▕ ->first();
35▕
➜ 36▕ return $model->columns()[$name];
37▕ }
38▕ }
39▕
+23 vendor frames
Hello,
Love this project, but I found a bug in the readme:
php artisan vendor:publish --tag=blueprint-nova-config
Should probably be
php artisan vendor:publish --tag=nova_blueprint
Hello there,
I just opened an issue on the readme, but I've been using this addon with pleasure.
One small thing though, my Nova resources aren't in the App\\Nova\\ModelName
location, but in a subfolder.
I also have a project where I put them in App\Models\Nova
(it made more sense in that project's context).
Therefore, I'd like to be able to customize the namespace infix, which could show up in the config.
The minimum required laravel version is at 7.x in composer.json, would it be possible to use this for laravel 6?
First off I want to thank you for this package!
As I was almost writing a generator myself and saw your package on the blueprint docs website.
I would love to discuss the possibility to use a simple configuration file that is used in the populateStub
function of the NovaGenerator
.
I think the following setup would be a bit more flexible for users that are using or are wanting to use this package.
Personally I would change the following code to something like the code in the second section.
$data = resolve(Pipeline::class)
->send($data)
->through([
new AddIdentifierField($model),
new AddRegularFields($model),
new AddRelationshipFields($model),
new AddTimestampFields($model),
new RemapImports(),
])
->thenReturn();
$data = resolve(Pipeline::class)
->send($data)
->through(config('nova_generator.field_tasks'))
->thenReturn();
return [
'field_tasks' => [
new AddIdentifierField($model),
new AddRegularFields($model),
new AddRelationshipFields($model),
new AddTimestampFields($model),
new RemapImports(),
],
];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.