A simple php class creator for laravel.

Overview

Laravel Make Class

Features

  • Create a php class from the command for any directory in the root name-space;
  • Store a custom path as an alias and use alias instead of full path.
  • Create interface | class | enum | trait.
  • Create final and abstract classes
  • Create class with a declare strict_type

Installation

composer require opheus2/laravel-makeclass

###Usages

File is created in root name-space. E.b App

php artisan make:class {name}

Default type is class.


File is created in test folder in root name-space. E.b App/Test

php artisan make:class Test\{name}

Create an interface type of class

php artisan make:class {name} -i
					or
php artisan make:class {name} --type interface

Available types flags
class (default no flag)
interface (-i or --interface)
trait (-T or --trait)
enum (-e or --enum)

Using custom path with alias

php artisan make:class {name} -i -p="Domains/Services/" --alias="ape"
					or
php artisan make:class {name} -i -p=Domain\Services\ --alias=ape
					or
php artisan make:class {name} -i -p Domain\Services\ --alias ape

Please note: You always need to add a trailing slash at the end for it to work properly. I would surely fix that soon.

Then you can use alias as path

php artisan make:class {name} -i -p="ape"

This would use the same old/saved path for subsequent file names


Using modifiers

php artisan make:class {name} -fx

This would create a final class with declare strict_types at the top You can use the -x flag to always add the strict type to any class type


Available modifiers flags
strict (-x or --strict)
final (-f or --final)
abstract (-a or --abstract)

For more info you can do

php artisan make:class --help

####Thank you

###TODO

  • Add check for trailing slash and auto fix
You might also like...
Validate your input data in a simple way, an easy way and right way. no framework required. For simple or large. project.

wepesi_validation this module will help to do your own input validation from http request POST or GET. INTEGRATION The integration is the simple thing

List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

A Laravel package that adds a simple image functionality to any Laravel model
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

A simple Laravel service provider for easily using HTMLPurifier inside Laravel

HTMLPurifier for Laravel 5/6/7/8 A simple Laravel service provider for easily using HTMLPurifier inside Laravel. From their website: HTML Purifier is

 Laravel Logable is a simple way to log http request in your Laravel application.
Laravel Logable is a simple way to log http request in your Laravel application.

Laravel Logable is a simple way to log http request in your Laravel application. Requirements php = 7.4 Laravel version = 6.0 Installation composer

Laravel HTMLMin - a simple HTML minifier for Laravel

Laravel HTMLMin Laravel HTMLMin is currently maintained by Raza Mehdi, and is a simple HTML minifier for Laravel. It utilises Mr Clay's Minify package

A simple PHP package to show SweetAlerts with the Laravel Framework
A simple PHP package to show SweetAlerts with the Laravel Framework

Easy Sweet Alert Messages for Laravel Installation Require the package using Composer. composer require uxweb/sweet-alert If using laravel 5.5 inclu

Simple user messaging package for Laravel

Laravel Messenger This package will allow you to add a full user messaging system into your Laravel application. Leave some feedback How are you using

Releases(v1.0.0)
Owner
orpheusohms
I'm a passionate full-stack developer
orpheusohms
A Formatter Class for Laravel 4 based on FuelPHP's Formatter Class

Changelog Update support for Laravel 6 & phpunit 8 Update composer.json Upgrade to PSR-4 add parameter newline, delimiter, enclosure, and escape to ex

Soapbox Innovations Inc. 249 Nov 29, 2022
A quick and incomplete example of how to validate a form using a FormValidator class on the simple-mvc

Simple MVC Description This repository is a simple PHP MVC structure from scratch. It uses some cool vendors/libraries such as Twig and Grumphp. For t

Romain Clair 1 Nov 24, 2021
27Laracurl Laravel wrapper package for PHP cURL class that provides OOP interface to cURL. [10/27/2015] View Details

Laracurl Laravel cURL Wrapper for Andreas Lutro's OOP cURL Class Installation To install the package, simply add the following to your Laravel install

zjango 8 Sep 9, 2018
A laravel package to generate class files from stub files.

Laravel Stub Generator A php laravel package to generate useable php files from given stub files . Installation Require the package using composer: co

Touhidur Rahman 31 Dec 29, 2022
Make any class queue aware in a Laravel app

Make any class queue aware This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Support us We in

Spatie 8 Jun 17, 2022
Is an Extension of Laravel View Class which compiles String Template on the fly. It automatically detects changes on your string template and recompiles it if needed.

Laravel-fly-view Is an Extension of Laravel View Class which compiles String Template on the fly. It automatically detects changes on your string temp

John Turingan 16 Jul 17, 2022
Helper class for working with Laravel Mix in WordPress themes and plugins.

Hybrid\Mix Hybrid Mix is a class for working with Lavarel Mix. It adds helper methods for quickly grabbing asset files cached in the mix-manifest.json

Theme Hybrid 9 Jun 2, 2022
Laravel-model-mapper - Map your model attributes to class properties with ease.

Laravel Model-Property Mapper This package provides functionality to map your model attributes to local class properties with the same names. The pack

Michael Rubel 15 Oct 29, 2022
Provide all attributes (including irregular patterns) to Laravel Blade class components.

blade-wants-attributes blade-wants-attributes offers you the ability to use Blade/HTML-defined attributes within the constructors of Laravel Blade cla

Stephan Casas 4 Sep 15, 2022
Generate and autoload custom Helpers, Builder Scope, Service class, Trait

laravel-make-extender Generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory. Generate Service class

Limewell 30 Dec 24, 2022