Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create docs site #196

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.DS_Store
vendor/
composer.lock

.vscode/
.node_modules/
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
593 changes: 593 additions & 0 deletions docs/docs/available-commands.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions docs/docs/configurations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 5
title: Configurations
---

## Configurations

Laravel-Code-Generator ships with lots of configurable option to give you control of the generated code. It is strongly recommended that you read the comments block above each option in the config/laravel-code-generator.php file to get familiar with all available options.

To override or extend the default settings to prevent you from losing your setting when upgrading the package. The `config/laravel-code-generator.php` is a dedicated file to store your options. This file will always be controlled by you and will never be overridden by the package. To override any configuration found in `config/laravel-code-generator.php`, simple add the same option in your custom file. The generator will look at the your configuration before falling back to the default config. Note, any array based option will be extended not overridden.

:::info
If you like to override default settings, you may execute the following command to publish a default configuration file to `/config/laravel-code-generator.php`

```
php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=config
```
:::

The most important option in the configuration file is `common_definitions`. This option allows you to set the default properties of new field using the name of that field. Your goal should be to generate 100% ready resource-file using this config. It will save you lots of time since all your fields will get generated using the desired properties. In another words, when using `resource-file:create`, `resource-file:append` or `resource-file:from-database` to create resource file, the generated JSON will be 100% ready for you without any manual modification.
43 changes: 43 additions & 0 deletions docs/docs/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
sidebar_position: 2
title: Getting Started
---

# Getting Started

### Installation

1. To download this package into your Laravel project, use the command-line to execute the following command

```
composer require crestapps/laravel-code-generator --dev
```

2. (You may skip this step when using Laravel >= 5.5)** To bootstrap the packages into your project while using command-line only, open the app/Providers/AppServiceProvider.php file in your project. Then, add the following code to the `register()` method.

```
if ($this->app->runningInConsole()) {
$this->app->register('CrestApps\CodeGenerator\CodeGeneratorServiceProvider');
}
```

#### Optional Steps

If you like to override default settings, you may execute the following command to publish a default configuration file to `/config/laravel-code-generator.php`

```
php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=config
```

If you like to override the default template, you may execute the following command to publish the default template to `/resources/laravel-code-generator/templates/default`

```
php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default-template
```

### Demo

Below a video to demonstrate how to use most of the package commands.

<iframe width="840" height="472" src="https://www.youtube.com/embed/l21qNcsMAWg?si=RbBsmeN06mq-o_5n" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

53 changes: 53 additions & 0 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
sidebar_position: 1
title: Introduction
---

## CrestApps - Laravel Code Generator

### Introduction

Enhance your Laravel development experience with our sophisticated code generator! This powerful tool is designed to streamline your workflow and save you valuable time. Whether you need to create views, controllers, routes, migrations, languages, or request forms, this versatile generator has got you covered – all in just seconds!

Experience the ultimate flexibility and customization options to cater to a wide range of use cases. Our code generator comes with a cross-browser compatible template and includes client-side validation to bring a modern touch to your application.

Explore the project's source code on [GitHub](https://github.com/CrestApps/laravel-code-generator), available under the permissive [MIT license](https://opensource.org/licenses/MIT). Upgrade your Laravel development with efficiency and style!


### Features

- Craft clean, reusable, and highly readable code for seamless development.
- Generate complete resources effortlessly with a single command, supporting both migration and existing database scenarios.
- Streamline resource creation for all existing database tables with a single command.
- Save and recreate fields using a JSON file, ensuring adaptability to changing business needs.
- Leverage JSON-based resource files for easy regeneration, even when business rules evolve.
- Generate standard CRUD controllers with simple or form-request validation.
- Customize view templates to alter the standard look and feel of your application.
- Create models with relations for comprehensive data representation.
- Establish named routes with and without grouping for efficient navigation.
- Generate standard CRUD views to facilitate a consistent user experience.
- Smart migration engine tracks generated migrations to only create necessary ones.
- Intelligent handling of model relations to simplify development.
- Highly flexible with rich configurable options to suit diverse needs.
- Easy commands for resource-file creation, addition, or reduction.
- Full support for generating multi-language applications.
- Implement client-side validation for enhanced user interaction.
- Efficiently handle file uploading and store multiple responses in the database.
- Generate form-request to clean up controllers and boost code reusability.
- Create view layouts with and without client-side validation.
- Change templates at runtime for diverse view generation.
- Ability to generate views with or without Laravel-Collective integration.
- Seamless handling of date, time, or datetime fields.
- Automatic management of boolean fields for hassle-free development.


### Dependencies

#### Prerequisite

- **[Laravel >= 5.1 framework.](https://laravel.com/)**
- **[Composer](https://getcomposer.org/)** installed on your local workstation.

#### Default template dependencies

- **[CSS bootstrap Framework.](http://getbootstrap.com/)** This is only required with the default template. You are free to make your own template.
10 changes: 10 additions & 0 deletions docs/docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
sidebar_position: 6
title: Release Notes
---

## Release Notes

- Upgraded the default theme to use Bootstrap 5.3.
- Improved the controller templates.
- Dropped support for Laravel-Collective Template.
Loading