• Stars
    star
    192
  • Rank 202,019 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code Generators for Laravel Applications and Packages

Code Generators for Laravel Applications and Packages

Canvas replicates all of the make artisan commands available in your basic Laravel application. It allows everyone to use it:

  • outside of Laravel installation such as when building Laravel packages.
  • with Laravel by allowing few customization to the stub resolved class and namespace.

tests Latest Stable Version Total Downloads Latest Unstable Version License Coverage Status

Installation

To install through composer, run the following command from terminal:

composer require --dev "orchestra/canvas"

Usages

As a Laravel developer, you should be familiar with the following commands:

Command. Description
make:channel Create a new channel class
make:command Create a new Artisan command
make:controller Create a new controller class
make:event Create a new event class
make:exception Create a new custom exception class
make:factory Create a new model factory
make:job Create a new job class
make:listener Create a new event listener class
make:mail Create a new email class
make:middleware Create a new middleware class
make:migration Create a new migration file
make:model Create a new Eloquent model class
make:notification Create a new notification class
make:observer Create a new observer class
make:policy Create a new policy class
make:provider Create a new service provider class
make:request Create a new form request class
make:resource Create a new resource
make:rule Create a new validation rule
make:seeder Create a new seeder class
make:test Create a new test class

Which can be execute via:

php artisan make:migration CreatePostsTable --create

With Canvas, you can run the equivalent command via:

composer exec canvas make:migration CreatePostsTable -- --create

canvas.yaml Preset file

To get started you can first create canvas.yaml in the root directory of your Laravel project or package.

Laravel preset

You can run the following command to create the file:

composer exec canvas preset laravel

Which will output the following as canvas.yaml:

preset: laravel

namespace: App

model:
  namespace: App

Package preset

You can run the following command to create the file:

composer exec canvas preset package

Which will output the following as canvas.yaml:

preset: package

namespace: PackageName
user-auth-provider: App\User

paths:
  src: src
  resource: resources

factory:
  path: database/factories

migration:
  path: database/migrations
  prefix: ''

console:
  namespace: PackageName\Console

model:
  namespace: PackageName

provider:
  namespace: PackageName

testing:
  namespace: PackageName\Tests

You need to change PackageName to the root namespace for your package.

Alternatively, you can set --namespace option to ensure the namespace is used in the file:

./vendor/bin/canvas preset package --namespace="Foo\Bar"
preset: package

namespace: Foo\Bar
user-auth-provider: App\User

paths:
  src: src
  resource: resources

factory:
  path: database/factories

migration:
  path: database/migrations
  prefix: ''

console:
  namespace: Foo\Bar\Console

model:
  namespace: Foo\Bar
  
provider:
  namespace: Foo\Bar

testing:
  namespace: Foo\Bar\Tests

Integration with Laravel

By default, you can always use composer exec canvas for Laravel and Packages environment. However, with the Package Discovery Orchestra\Canvas\LaravelServiceProvider will be installed automatically and override all default make command available via artisan so you can use it without changing anything.

More Repositories

1

testbench

Laravel Testing Helper for Packages Development
PHP
2,096
star
2

tenanti

[Package] Multi-tenant Database Schema Manager for Laravel
PHP
589
star
3

parser

[Package] XML Document Parser for Laravel and PHP
PHP
446
star
4

platform

Orchestra Platform Application Skeleton
PHP
314
star
5

testbench-core

Testing Helper for Laravel Development
PHP
258
star
6

testbench-dusk

Laravel Dusk Testing Helper for Package Development
PHP
101
star
7

imagine

[Package] Imagine Image Manipulation Wrapper for Laravel
PHP
67
star
8

foundation

Orchestra Platform Foundation
PHP
56
star
9

asset

Asset Component for Orchestra Platform
PHP
55
star
10

workbench

Workbench Companion for Laravel Packages Development
PHP
42
star
11

orchestra

[DEPRECATED] Orchestra Platform 1.x for Laravel 3
PHP
38
star
12

html

HTML Component for Orchestra Platform
PHP
37
star
13

testbench-browser-kit

Laravel Browser Kit Testing Helper for Packages Development
PHP
35
star
14

auth

Auth Component for Orchestra Platform
PHP
24
star
15

database

[READ-ONLY] Database Component for Orchestra Platform
PHP
20
star
16

support

Support Component for Orchestra Platform
PHP
16
star
17

orchestraplatform.com

Orchestra Platform Website
PHP
15
star
18

debug

[Package] Artisan Debug Profiler for Laravel
PHP
14
star
19

story

[Extension] Story CMS for Orchestra Platform
PHP
14
star
20

contracts

Contracts for Orchestra Platform
PHP
12
star
21

dusk-updater

Updater for Laravel Dusk ChromeDriver binaries
PHP
10
star
22

cello

[DEPRECATED] Cello CMS Extension for Orchestra Platform 1.x
PHP
9
star
23

canvas-core

Code Generators Builder for Laravel Applications and Packages
PHP
9
star
24

memory

Memory Component for Orchestra Platform
PHP
9
star
25

model

Model Component for Orchestra Platform
PHP
8
star
26

translation

Translation Component for Orchestra Platform
PHP
8
star
27

avatar

Avatar Component for Orchestra Platform
PHP
8
star
28

kernel

Orchestra Platform Kernel
PHP
8
star
29

config

[READ-ONLY] Configuration Component for Laravel and Orchestra Platform
PHP
7
star
30

javie

Javie Client-side JavaScript Library
TypeScript
7
star
31

control

[Extension] Control for Orchestra Platform
PHP
7
star
32

view

View Component for Orchestra Platform
PHP
6
star
33

awesome

A curated list of bookmarks, extensions, tutorials, videos and other cool resources from the Orchestra Platform ecosystem
6
star
34

theme-installer

Theme Installer for Orchestra Platform
PHP
6
star
35

testing

Orchestra Platform Testing Helper
PHP
6
star
36

publisher

[DEPRECATED] Publisher Component for Orchestra Platform
PHP
6
star
37

notifier

Notifier Component for Orchestra Platform
PHP
6
star
38

support-facades

[READ-ONLY] Support (Facades) Component for Orchestra Platform
PHP
6
star
39

docs

Orchestra Platform Documentation
PHP
5
star
40

lumenate

Orchestra Platform Lumenate Installer
PHP
5
star
41

cookbook

Orchestra Platform 3 Cookbook
5
star
42

lumen

Lumen Framework for Orchestra Platform
PHP
4
star
43

oneauth

Social Authentication Extension for Orchestra Platform
PHP
4
star
44

extension

Extension Component for Orchestra Platform
PHP
4
star
45

pest-plugin-testbench

PHP
3
star
46

facile

Facile Component for Orchestra Platform
PHP
3
star
47

messages

Messages Component for Laravel and Orchestra Platform
PHP
3
star
48

support-providers

[READ-ONLY] Support (Providers) Component for Orchestra Platform
PHP
3
star
49

installer

Orchestra Platform Installer
PHP
3
star
50

studio

Code Generator for Orchestra Platform
PHP
3
star
51

learn

Learn Orchestra Platform 3
CSS
2
star
52

widget

Widget Component for Orchestra Platform
PHP
2
star
53

authorize

[DEPRECATED] Acl and Role Manager for Orchestra Platform 1.x
PHP
2
star
54

support-core

[READ-ONLY] Support (Core) Component for Orchestra Platform
PHP
2
star
55

transporter

Migration Toolkit: Creating ORM Compatible Structure from Legacy Database
PHP
2
star
56

resources

[DEPRECATED] Resources Component for Orchestra Platform
PHP
1
star
57

optimize

[DEPRECATED] Optimize Component for Orchestra Platform
PHP
1
star
58

lumen-testbench

PHP
1
star
59

preview

[DEPRECATED] Preview Bundle for Developing with Orchestra Platform 1.x
PHP
1
star
60

melody

[DEPRECATED] Theme Manager for Orchestra Platform 1.x
PHP
1
star
61

hashing

[READ-ONLY] Hashing Component for Laravel and Orchestra Platform
PHP
1
star
62

robotix

[DEPRECATED] Robots.txt Extension for Orchestra Platform 1.x
PHP
1
star
63

authorization

[READ-ONLY] Authorization Component for Orchestra Platform
PHP
1
star
64

localtime

[DEPRECATED] Localtime Extension for Orchestra Platform 1.x
PHP
1
star
65

kurenai

[ABANDONED] Kurenai is a Markdown document parser which allows for extra metadata to be associated with the document.
PHP
1
star