定制 ahmadyousefdev/automs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ahmadyousefdev/automs

Composer 安装命令:

composer require ahmadyousefdev/automs

包简介

An auto management system model generator

README 文档

README

Latest Version on Packagist Total Downloads

This tool allows you to create a fully functional component for Laravel using its Jetstream dashboard by one line. Watch this video to see how you can install it and how it works.

Requirements

Automs requires 3 main packages in order to work properly

  1. Laravel framework ^8
  2. laravel jetstream ^2
  3. livewire ^2

Installation

Via Composer

$ composer require "ahmadyousefdev/automs" --dev

We included Jetstream and livewire in the composer installer

you have to complete the installation of these two packages by running these commands

php artisan jetstream:install livewire
npm install
npm run dev
php artisan migrate
php artisan vendor:publish --tag=jetstream-views

to learn more about Jetstream and Livewire and how to install them properly please go to this link.

Usage

basically, you will write the desired model name and this package will generate it by running this command

php artisan automs:create modelName

After that you can check the migration file and if everything is alright you should run

php artisan migrate

Example

Let's create a component named Article, we will do that by just writing this command

php artisan automs:create article

if we run this command, the package will generate the next files

app/Models/Article.php
app/Http/Controllers/ArticleController.php
database/migrations/timestamp_create_articles_table.php
resources/views/articles/index.blade.php
resources/views/articles/create.blade.php
resources/views/articles/show.blade.php
resources/views/articles/edit.blade.php

and it will add those routes to routes/web.php :

use App\Http\Controllers\ArticleController;
Route::group(['prefix' => 'articles', 'middleware' => ['auth']], function () {
    Route::get('/', [ArticleController::class, 'index'])->name('articles.index');
    Route::get('/create', [ArticleController::class, 'create'])->name('articles.create');
    Route::post('/submit',[ArticleController::class, 'store'])->name('articles.store');
    Route::get('/id_{id}', [ArticleController::class, 'show'])->name('articles.show');
    Route::get('/id_{id}/edit',[ArticleController::class, 'edit'])->name('articles.edit');
    Route::put('/id_{id}/update',[ArticleController::class, 'update'])->name('articles.update');
    Route::put('/id_{id}/destroy',[ArticleController::class, 'destroy'])->name('articles.destroy');
});

and will add a navigation link for this model to resources/views/navigation-menu.blade.php

Those files will either be filled with data or they will have the minimal look, depending on the name of the article, please read How does it work section for more details

How does it work ?

This package have a set of built-in laravel component definitions that are connected to multiple names. When running the command, the package will search for the name of the written model in its component list. If it finds that name, it will generate its files. If it didn't find any component, it will generate the files but without the fillables and the migration rows.

A full list of the built-in components can be found inside this json file

Notes

if there is a file uploader in any component, it will use the default public disk as a storage. go to your config/filesystems.php to configure the storage, or if you are comfortable with the existing settings you can run php artisan storage:link to connect the public path to the storage path.

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details.

Security

If you discover any security related issues, please email ahmedyousefdev@gmail.com instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

Acknowledgements

Influencer References

These two packages inspired us to make this package and they provide much more commands which makes them suitable for more complex applications. Sadly, they don't support Laravel 8 or Jetstream yet.

Other links

统计信息

  • 总下载量: 66
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固