coolsam726 / jetstream-inertia-generator Goto Github PK
View Code? Open in Web Editor NEWLaravel 8 Admin CRUD generator built with Jetstream, Inertia js, Vue 3 and Tailwindcss 2
License: MIT License
Laravel 8 Admin CRUD generator built with Jetstream, Inertia js, Vue 3 and Tailwindcss 2
License: MIT License
Extract the controllers' show() logic to the Repository to allow uniform re-use in both the api controller and the frontend controller
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
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:
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):
** 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?
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.
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": []
}}]
},
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,
];
}
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.
Currently there is no way of returning an error or a success message. Adding a shared flash key which carries both success and error keys could be of great help.
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.
Now that vue has moved to 3 with some breaking changes, there is need to refactor the app to use vue3 instead. For vue2 users, we can continue supporting v1.x and release v2.x which uses vue3.
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.
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].
Vue3 uses useForm instead of this.$inertia.form. Changing the code generator to factor in this would be great.
support for enum datatype
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?
It will be nice if this could work with jetstream InertiaJS?
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?
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)
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.
Show form seems to have misplaced tags and lacks the space-y-separator.
The above error is encountered when generating a crud with a foreign key that does not end in _id. It results from a typo in the Columns Class where Str::singlular()
is supposed to be Str::singular()
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
yarn build
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.
Only one column should be marked as unique and filtered against the other columns.
Any plans on supporting PHP 8!
Really diggin what I'm seeing here and PHP 8 support would be awesome!
Cheers!
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.
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:
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:
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
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.
Could you help with making it?
I'm struggling with doing that way to long.
Can't find prop/data for selected value on the list and don't have knowledge to do it myself (just learning JS)
Maybe it's not working from the start because "reduce" is not precised?
Update the Publishes in README to include newly added publishes.
Forms (Create and Edit, Show) and Datatables should be refactored to different components so that they can be re-used in modals.
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?
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);
}
Currently Roles, Users and permissions are generated just like any other modules, but these are unique and should have their own generation commands
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.