Giter Club home page Giter Club logo

Comments (5)

salmazz avatar salmazz commented on July 24, 2024

what are u doing for this issue?

from voyager.

Emerica avatar Emerica commented on July 24, 2024

Just use the required options in the bread, unless that's the actual bug here?
No asterisk's are displayed, but validation should fail and then present a warning, a little late, sure.
{
"validation": {
"rule": "required"
}
}

I wouldn't consider this a bug. There's no need to assume they are required fields. Probably, sure, but not required.
You have the ability to overload the BREAD resources and specify a controller to control these aspects for the needs of your application.

Make a /resources/vendor/voyager/[model]/ folder , so /resources/vendor/voyager/users/
Copy the /vendor/tcg/voyager/resources/views/users/edit-add.blade.php to /resources/vendor/voyager/users/edit-add.blade.php

^ make your changes to that blade, maybe make a list of "required" options in your User model like fillable. Or dive into where the validations are stored.
Then in your edited blade, as you loop through the model columns your can check if it's in the models required array and add your asterisk's and any other logic.

Then if you need more can extend the VoyagerBaseController, or make your own, and point your bread at that controller instead of the default.

from voyager.

blpraveen avatar blpraveen commented on July 24, 2024

Hi @Emerica
Is it possible to use/override one edit-add.blade.php to all models?

from voyager.

Emerica avatar Emerica commented on July 24, 2024

@blpraveen Just wakin' up, so the brainpan might not be top notch, but you could try sym-linking?

from voyager.

Emerica avatar Emerica commented on July 24, 2024

Revisiting this hacky solution, you could also copy the VoyagerBaseController into your project and then change how it operates, point at a single blade instead of it being dynamic.
With the dev cycle now being kinda dead you at least don't need to worry about it changing as much.

$view = 'voyager::bread.edit-add';

if (view()->exists("voyager::$slug.edit-add")) {

from voyager.

Related Issues (20)

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.