orchestral / canvas Goto Github PK
View Code? Open in Web Editor NEWCode Generators for Laravel Applications and Packages
Home Page: https://packagist.org/packages/orchestra/canvas
License: MIT License
Code Generators for Laravel Applications and Packages
Home Page: https://packagist.org/packages/orchestra/canvas
License: MIT License
We use https://github.com/Jeroen-G/laravel-packager for package development.
All make:### commands put the generated result into the vendor folder.
I have not testet every single make-command, but all I tested did not work for me.
Example:
vendor/bin/canvas make:model TestModel
outputs to: ./vendor/orchestra/testbench-core/laravel/app/Models/TestModel.php
but should go to ./src/Models/TestModel.php
php artisan package:new some-vendor some-package-name --skeleton="https://www.robin-rick.de/laravel11-package-skeleton.zip"
vendor/bin/canvas preset package
(with namespace argument) to generate canvas.yamlvendor/bin/canvas make:model TestModel
Running the command "make:seeder" results in the error attached as a screenshot.
run the command: composer exec canvas make:seeder YourSeeder
Add an entry for the $app->add() for Seeder. See attach screenshot
Running the make:view command in the context of a package with a published canvas file, puts the view inside the following folder:
vendor/bin/canvas make:view
┌ What should the view be named? ──────────────────────────────┐
│ career │
└──────────────────────────────────────────────────────────────┘
INFO View [vendor/orchestra/testbench-core/laravel/resources/views/career.blade.php] created successfully.
vendor/bin/canvas preset package
to generate the attached canvas.yml file.vendor/bin/canvas make:view
command and provide a name.preset: package
namespace: Creode\LaravelCareers
user-auth-model: App\Models\User
paths:
src: src
resource: resources
factory:
path: database/factories
migration:
path: database/migrations
prefix: ''
console:
namespace: Creode\LaravelCareers\Console
model:
namespace: Creode\LaravelCareers\Models
provider:
namespace: Creode\LaravelCareers\Providers
testing:
namespace: Creode\LaravelCareers\Tests
stub file: storage/database/factories/factory.stub
I noticed my make:
commands had a --preset
flag with the semi-helpful description Preset used when generating $X that I couldn't find any documentation for, and that didn't appear in the framework's make commands.
Long story short, I discovered the commands had been overridden by canvas, which had been installed via Psalm's Laravel plugin:
composer why orchestra/canvas -t orchestra/canvas v8.11.3 Code Generators for Laravel Applications and Packages ├──orchestra/canvas-core v8.10.0 (conflicts orchestra/canvas <8.11.0) (circular dependency aborted here) └──orchestra/workbench v8.0.0 (requires orchestra/canvas ^8.11) └──orchestra/testbench v8.14.1 (requires orchestra/workbench ^1.0 || ^8.0) └──psalm/plugin-laravel v2.8.0 (requires orchestra/testbench ^7.19 || ^8.0) └──my/app dev-main (requires (for development) psalm/plugin-laravel ^2.8)
I understand how and why this works the way it does from the service discovery side, but it still feels way too far-reaching to silently override the commands without any hints to the developer.
I should not have to expect side effects to the way my application works from installing an apparently unrelated third-party dependency.
My suggestion is thus:
I'm using this package outside laravel to create my own package
I'm getting error which says Illuminate\Foundation\Inspiring not found while creating component.
u can found the stack trace in this image https://prnt.sc/torwsw
mkdir PackageName
cd PackageName
composer init
composer require --dev "orchestra\canvas"
./vendor/bin/canvas preset package --namespace "ClassName"
./vendor/bin/canvas make:component HelloComponent
Refers to:
Can you add support for anonymous classes when creating migration as described here https://laravel.com/docs/8.x/migrations#anonymous-migrations
I'm developing a Laravel ^8.x package so I wanted to use this package as part of my test suite. I was gonna contribute with a PR to support that version of Laravel, but I noticed you already have version 6 in the making which support the version of laravel I'm using. Do you have a ETA for version 6?
model: App
extends: Orchestra\Model\Eloquent
Hi @crynobone,
Thanks for the package!
Model factory generator assigns Database\Factories
namespace by default with the package preset, I guess we should be able to specify a custom namespace in YAML config. What do you think?
Thanks,
E
Utilizing the make:test
command with the --pest option results in a PHPUnit test.
MyTest
composer exec canvas make:test MyTest -- --pest
completes, but utilizes the PHPUnit stub instead of Pest.Please disregard the default bash prompt and the missing lines from the top of the file due to tail
. There were some privacy concerns with using my typical ZSH shell and showing the package namespace, but this does happen in ZSH as well.
Hello!
Quick question. Is there a way to specify where models should be placed when running canvas make:model
? I tried adding path: src/Models
to the yaml file but no luck there.
Thanks in advance for the help!
Similar to this issue #32, running a command on a package to make "Actions" and "Repeatables" (haven't tested the other nova types so this could also affect those). The outputted files get put into: /vendor/orchestra/testbench-core/laravel/app/Nova/Actions
Create a new package in Laravel I'm using this skeleton by Spatie and require canvas.
/vendor/orchestra/testbench-core/laravel/app/Nova/Actions
folder rather than the packages src/Nova/Actions
folder.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.