Code Monkey home page Code Monkey logo

coolsam726 / jetstream-inertia-generator Goto Github PK

View Code? Open in Web Editor NEW
118.0 118.0 30.0 1.74 MB

Laravel 8 Admin CRUD generator built with Jetstream, Inertia js, Vue 3 and Tailwindcss 2

License: MIT License

PHP 19.69% Blade 47.08% Vue 32.53% JavaScript 0.37% TypeScript 0.32% CSS 0.01%
admin-cruds admin-generator api-generator code-generators crud-generator inertia inertiajs jetstream jetstream-generators jetstream-inertia jetstream-inertia-generator jig laravel laravel-generators savannabits tailwindcss vue vue3 vuejs

jetstream-inertia-generator's People

Contributors

coolsam726 avatar gbrits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jetstream-inertia-generator's Issues

Add default admin user

Currently it is hard to start the application after setup because there is no system user. Adding a migration to seed the default admin user with administrator role would help

Dependency Issue

Describe the bug
I'm setting a new project using this package jetstream-inertia-generator
and I got a dependency issue.

To Reproduce
Steps to reproduce the behavior:

  1. New Laravel 8 instalation
  2. Add Laravel Jetstream using Inertia
    https://jetstream.laravel.com/2.x/introduction.html
  3. Requeriments listed in README.md:
    :: spatie/laravel-permission
    composer require spatie/laravel-permission
    php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
    php artisan optimize:clear
    php artisan migrate
    :: laravel/sanctum
    composer require laravel/sanctum
    php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
    php artisan migrate
  4. Finaly, install:
    composer require savannabits/jetstream-inertia-generator --with-all-dependencies
  5. See error

Expected behavior
This error message:

composer require savannabits/jetstream-inertia-generator --with-all-dependencies
Using version ^3.0 for savannabits/jetstream-inertia-generator
./composer.json has been updated
Running composer update savannabits/jetstream-inertia-generator --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - savannabits/jetstream-inertia-generator[v3.0.0-beta.0, ..., v3.0.4] require spatie/laravel-permission ^4.2 -> found spatie/laravel-permission[4.2.0, ..., v4.x-dev] but it conflicts with your root composer.json require 
(^5.3).
    - Root composer.json requires savannabits/jetstream-inertia-generator ^3.0 -> satisfiable by savannabits/jetstream-inertia-generator[v3.0.0-beta.0, ..., v3.0.4].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require savannabits/jetstream-inertia-generator:*" to figure out if any version is installable, or "composer require savannabits/jetstream-inertia-generator:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Desktop (please complete the following information):

  • OS: Windows 10
  • Composer version 2.1.10 2021-10-29 22:34:57

** Update 1: **
I see this is related to the conflict between the required spatie/laravel-permission:^4.2 and my compose which requires the latest ^5.3 version.
Could you please upgrade it to the new spatie/laravel-permission series?

Make Relationships Optional in Show page

For optional belongsTo Relationships, trying to access a nested key throws a js error. e.g if books.author is optional, the generated code still tries to access books.author.name without checking for null first. This throws a javascript error.

Submenu - no proper documentation or example available

Sub menu not working for me there is also not much documentation or example for that

I tried this :

"categories": {
"route": "admin.categories.index",
"title": "Categories",
"routePattern": "admin.categories.",
"faIcon": "far fa-clone",
"isTitle": true,
"isParent": true,
"children": [{"sub-categories": {
"route": "admin.sub-categories.index",
"title": "Sub Categories",
"routePattern": "admin.categories.
",
"faIcon": "far fa-clone",
"isTitle": false,
"isParent": false,
"children": []
}}]
},

\Auth::user()->can() generated in Models has no null check

The getCanAttribute() function in generated model should have an Auth::check() in order to still be able to use the model when no user is logged in. Currently it throws errors

Example fix:

public function getCanAttribute() {
        return [
            "view" => \Auth::check() ? \Auth::user()->can("view", $this) : false,
            "update" => \Auth::check() ? \Auth::user()->can("update", $this) : false,
            "delete" => \Auth::check() ? \Auth::user()->can("delete", $this) : false,
            "restore" => \Auth::check() ? \Auth::user()->can("restore", $this) : false,
            "forceDelete" => \Auth::check() ? \Auth::user()->can("forceDelete", $this) : false,
        ];
    }

Use Jajra/Datatables instead of Pagetables

Is this something we could consider for better responsiveness and flexibility? The goal was to avoid using jQuery at all costs but it seems that for the best datatables solutions, we are still stuck with jquery for now.

Modification of boilerplate

How can I adjust myself auto generated code for field titles?
To make changes that will suite my needs inside
views, repository dtColumns() and api controller index()?

I ask because i have 300 columns table
To make it more manageable i thought about making own helper class that will accept field name and return title. That way it will be possible to change things centrally for many places in app.

It would be something like this in php:

Column::make('field_name')->title(report_title('field_name'))

Or in Vue form

<jet-label for="field_name" :value="fields.field_name.title" />

I'm actually thinking about long and short titles (forms and data tables) and more, like types of values for stats, advanced filters.

Could not resolve './Deselect'

How can I resolve the following error?

*✓ 287 modules transformed.
Could not resolve './Deselect' from node_modules\vue-select\src\components\childComponents.js
error during build:
Error: Could not resolve './Deselect' from node_modules\vue-select\src\components\childComponents.js
at error (C:\laragon\www\fig\node_modules\rollup\dist\shared\rollup.js:158:30)
at ModuleLoader.handleResolveId (C:\laragon\www\fig\node_modules\rollup\dist\shared\rollup.js:22345:24)
at C:\laragon\www\fig\node_modules\rollup\dist\shared\rollup.js:22319:26
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Support php 8.2

Problem 1
- savannabits/jetstream-inertia-generator[v1.0.0, ..., v1.1.0, v2.0.0, ..., v2.1.4] require php ^7.4 -> your php version (8.2.2) does not satisfy that requirement.
- savannabits/jetstream-inertia-generator[v2.2.0, ..., v2.2.3] require illuminate/support ^v8.40 -> found illuminate/support[v8.40.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
- savannabits/jetstream-inertia-generator[v2.3.0, ..., v2.4.0, v3.0.0, ..., v3.1.0] require illuminate/support ^8 -> found illuminate/support[v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
- savannabits/jetstream-inertia-generator v3.2.0 requires inertiajs/inertia-laravel ^0.4 -> found inertiajs/inertia-laravel[v0.4.0, ..., v0.4.5] but it conflicts with your root composer.json require (^0.6.8).
- savannabits/jetstream-inertia-generator[v3.2.1, ..., v3.3.0] require inertiajs/inertia-laravel ^0.5 -> found inertiajs/inertia-laravel[v0.5.0, ..., v0.5.4] but it conflicts with your root composer.json require (^0.6.8).
- Root composer.json requires savannabits/jetstream-inertia-generator * -> satisfiable by savannabits/jetstream-inertia-generator[v1.0.0, ..., v1.1.0, v2.0.0, ..., v2.4.0, v3.0.0, ..., v3.3.0].

Cant install vue-select

During installation, when running:
npm install --include=dev --legacy-peer-deps savannabits/vue-select#v4.0.0-alpha.0

i get error:
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/savannabits/vue-select.git
npm ERR! Warning: Permanently added the RSA host key for IP address '140.82.121.4' to the list of known hosts.
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.

Can sagalbot/vue-select be used instead?

Excel export

How do Excel/export boilerplate work?
I can see generator adds this to controllers:

use App\Exports\ClassNameExport; 
use Maatwebsite\Excel\Excel //<-- no semicolon

But except that cant find out how data export works?

innocenzi/laravel-vite package should be removed for laravel 10

in the composer.json file intended for laravel 10 there is still the innocenzi/laravel-vite package
it should be removed in order to install jetstream-inertia-generator correctly
otherwise, the following error appears when trying to load the page

ERROR: htmlspecialchars(): Argument #1 ($string) must be of type string, array given {"view":{"view":"/var/www/html/dev/resources/views/app.blade.php","data":[]},"exception":"[object] (Spatie\LaravelIgnition\Exceptions\ViewException(code: 0): htmlspecialchars(): Argument #1 ($string) must be of type string, array given at /var/www/html/dev/vendor/laravel/framework/src/Illuminate/Support/helpers.php:124)

More info on features needed

How displaying messages/errors work?
It stopped working for me and I dont know how to fix it.
I see method inside Create.vue views:

onSuccess(msg) {
    this.displayNotification('success',msg);
}

But cant figure it out, where the code goes further.

Fix the Show Form

Show form seems to have misplaced tags and lacks the space-y-separator.

InfiniteSelect Error: Can't find stylesheet to import.

Describe the bug
While running yarn build, Typescript throws the following error:
Error: Can't find stylesheet to import.

2 │ @import "~vue-select/src/scss/vue-select.scss";
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

resources/js/JigComponents/InfiniteSelect.vue 2:9 root stylesheet

To Reproduce

  1. Install using normal steps as described
  2. Run yarn build

Readme

Hi, thanks for you making this available. Here is a minor suggestion for the readme.

In the installation instructions it says "2. Install the yarn dependencies listed above" - but they're not listed above. Maybe delete that, or provide the list.

So instead I adapted the yarn command (I use NPM). For npm it is

npm install --save-dev pagetables popper.js @babel/plugin-syntax-dynamic-import dayjs dotenv numeral portal-vue postcss postcss-import pusher-js laravel-echo sass sass-loader vue3-vt-notifications vue-flatpickr-component vue-numerals vue-pdf mitt "https://github.com/sagalbot/vue-select/tarball/feat/vue-3-compat"

You could include that for npm users.

PHP 8

Any plans on supporting PHP 8!

Really diggin what I'm seeing here and PHP 8 support would be awesome!

Cheers!

Error after fresh installation - Laravel 8

Describe the bug
Performed a fresh installation with Laravel 8.

Loading the home page, I'm returned the following error:

nnocenzi\Vite\Exceptions\ManifestNotFound The manifest could not be found. Did you start the development server? Tried: /var/www/html/public/build/manifest.json (View: /var/www/html/resources/views/app.blade.php)

Expected behavior
Page loads correctly.

Screenshots
Screen Shot

DataTables warning: table id=users-dt - Ajax error. For more information about this error, please see http://datatables.net/tn/7

Bug Description
When i try to click backend modules it sends "DataTables warning: table id=users-dt - Ajax error. For more information about this error, please see http://datatables.net/tn/7" error

To Reproduce
Steps to reproduce the behavior:

  1. After install jig and 'php artisan serve' and login. Go to 'backend'
  2. Click on 'permissions or roles or users'
  3. It will show pop up and display the error with 'DataTables warning: table id=users-dt - Ajax error. For more information about this error, please see http://datatables.net/tn/7'

Expected behavior
I dont know why this is happen, it's my first time use jig, maybe the problem is yajra datatables

Screenshots
I want to share a screenshot but i don't know how to do it, i will send it later after i find out

Desktop:

  • OS: [windows 11 pro]
  • Browser [microsoft edge]

Missing dependencies

Step 11
Installation process is missing module vite/dynamic-import-polyfill

I've installed it as /dynamic-import-polyfill and updated /resources/scripts/main.ts accordingly.
I guess it works same as vite module.


Also code inside resources/js/app.js seems to be wrong (consists require command) or missing requirejs module.
The app is throwing :
Uncaught ReferenceError: require is not defined at app.js:1

Add break-words to ShowForm

Sometimes showForm may have longer than usual words, such as long keys. In this case it is necessary to use tailwind's break-words to allow wrapping of these keys.

Pagetables don't work with self join.

Pagetables don't work with self join. Below is query that works perfectly fine with Yaraja tables.

$cols = [
        Column::name('id')->title('Id')->sort()->searchable(),
        Column::name('nazwa')->title('Nazwa')->sort()->searchable(),
        Column::name('ulica_so')->title('Ulica So')->sort()->searchable(),
        Column::name('kod_so')->title('Kod So')->sort()->searchable(),
        Column::name('poczta_so')->title('Poczta So')->sort()->searchable(),
    ];

$query = Branch::leftJoin('branches as pow','branches.pow_id','=','pow.id')
                       ->leftJoin('branches as woj','branches.woj_id','=','woj.id')
                       ->select('branches.id',
                                'branches.nazwa',
                                'branches.ulica_so',
                                'branches.kod_so',
                                'branches.poczta_so',
                                'pow.nazwa as pow_nazwa',
                                'woj.nazwa as woj_nazwa');

$data = Pagetables::of($query)->columns($cols)->make(true);

This causes error:

Column 'id' in where clause is ambiguous

(SQL: select `branches`.`id`, `branches`.`nazwa`, `branches`.`ulica_so`, `branches`.`kod_so`, `branches`.`poczta_so`, `pow`.`nazwa` as `pow_nazwa`, `woj`.`nazwa` as `woj_nazwa` from `branches` left join `branches` as `pow` on `branches`.`pow_id` = `pow`.`id` left join `branches` as `woj` on `branches`.`woj_id` = `woj`.`id` where (`id` LIKE %% or `nazwa` LIKE %% or `ulica_so` LIKE %% or `kod_so` LIKE %% or `poczta_so` LIKE %%))

Problem is that column names are passed to WHERE part without table name.

I was trying to go around this problem trying to exclude id from searching but further problems turned out:

Column::name('id')->title('Id')->sort()->searchable(false);

ends with error
Unknown column '' in 'where clause'

(SQL: select `branches`.`id`, `branches`.`nazwa`, `branches`.`ulica_so`, `branches`.`kod_so`, `branches`.`poczta_so`, `pow`.`nazwa` as `pow_nazwa`, `woj`.`nazwa` as `woj_nazwa` from `branches` left join `branches` as `pow` on `branches`.`pow_id` = `pow`.`id` left join `branches` as `woj` on `branches`.`woj_id` = `woj`.`id` where (`` LIKE %% or `nazwa` LIKE %% or `ulica_so` LIKE %% or `kod_so` LIKE %% or `poczta_so` LIKE %%))

Column::name('id')->title('Id')->sort()->searchable(false)->raw(true);

ends with error
Savannabits\Pagetables\Pagetables::applySearch(): Argument #1 ($column) must be of type Savannabits\Pagetables\Column, null given,

I'm sorry for harrassing with issues. I'd love to help you but im currently working till late nights on deadline. Ill help with docs when ill finish.

what is index action in controller in API being used for

what is index action in controller in API being used for?

public function index(IndexStore $request)
{
$query = Store::query(); // You can extend this however you want.
$cols = [
Column::name('id')->title('Id')->sort()->searchable(),
Column::name('location_name')->title('Location Name')->sort()->searchable(),
Column::name('address_1')->title('Address 1')->sort()->searchable(),
Column::name('address_2')->title('Address 2')->sort()->searchable(),
Column::name('city')->title('City')->sort()->searchable(),
Column::name('province')->title('Province')->sort()->searchable(),
Column::name('email')->title('Email')->sort()->searchable(),
Column::name('phone_no')->title('Phone No')->sort()->searchable(),
Column::name('updated_at')->title('Updated At')->sort()->searchable(),

        Column::name('actions')->title('')->raw()
    ];
    $data = Pagetables::of($query)->columns($cols)->make(true);
    return $this->api->success()->message("List of Stores")->payload($data)->send();
}

public function dt(Request $request) {
    $query = Store::query()->select(Store::getModel()->getTable().'.*'); // You can extend this however you want.
    return $this->repo::dt($query);
}

How to remove column from index view

How I can control which column are displayed for a given index view?
By default, Jig shows all the field names in the Index. I don't want this most times.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.