Laravel, how to validate an enum columnLaravel - Eloquent or Fluent random rowLaravel requires the Mcrypt PHP extensionLaravel 4 Eloquent Query Using WHERE with OR AND OR?How to Use Order By for Multiple Columns in Laravel 4?Laravel Eloquent: Ordering results of all()Laravel 4: how to “order by” using Eloquent ORMHow to Create Multiple Where Clause Query Using Laravel Eloquent?Get Specific Columns Using “With()” Function in Laravel EloquentGet the Last Inserted Id Using Laravel EloquentLaravel Migration Change to Make a Column Nullable

What is realistic quality of computer blueprints quickly backed up before apocalypse and their impact on future design?

Does KNN have a loss function?

Should 2FA be enabled on service accounts?

Went to a big 4 but got fired for underperformance in a year recently - Now every one thinks I'm pro - How to balance expectations?

Misrepresentation on DS-160

Can I say "Gesundheit" if someone is coughing?

Feedback diagram

Why is “deal 6 damage” a legit phrase?

Were there any unmanned expeditions to the moon that returned to Earth prior to Apollo?

Backpacking with incontinence

Ernie and the Superconducting Boxes

Is it moral to remove/hide certain parts of a photo, as a photographer?

Partial Fractions: Why does this shortcut method work?

Python π = 1 + (1/2) + (1/3) + (1/4) - (1/5) + (1/6) + (1/7) + (1/8) + (1/9) - (1/10) ...1748 Euler

If I buy and download a game through second Nintendo account do I own it on my main account too?

What is the reason behind water not falling from a bucket at the top of loop?

A way of getting tenure for a non-creative person

Is Illustrator accurate for business card sizes?

Reasons for using monsters as bioweapons

Could flaps be raised upward to serve as spoilers / lift dumpers?

How to trick a fairly simplistic kill-counter?

Should I take up a Creative Writing online course?

Does the problem of P vs NP come under the category of Operational Research?

Can birds evolve without trees?



Laravel, how to validate an enum column


Laravel - Eloquent or Fluent random rowLaravel requires the Mcrypt PHP extensionLaravel 4 Eloquent Query Using WHERE with OR AND OR?How to Use Order By for Multiple Columns in Laravel 4?Laravel Eloquent: Ordering results of all()Laravel 4: how to “order by” using Eloquent ORMHow to Create Multiple Where Clause Query Using Laravel Eloquent?Get Specific Columns Using “With()” Function in Laravel EloquentGet the Last Inserted Id Using Laravel EloquentLaravel Migration Change to Make a Column Nullable






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to make an enum column validation in laravel. This is the code of my validator.



/**
* Returns the rules and messages for validating this creation
*/
public static function ValidationBook($except = [], $append = []) string',
'concert.user_id' => 'required


The enum column is the type column. Also I've tried to do 'concert.type' => 'required|in:public,private'



Then I create my Validator using the following code:



$vb = Concert::ValidationBook($except, $append);
$validator = Validator::make($data, $vb['rules'], $vb['messages']);


But for some reason, when I send the post via Postman, i got "detail": "Undefined index: concert.type".
Even when my data is:




"concert":
"title": "Title",
"type": "novalidtype",
"status": "open"




Thanks in advance










share|improve this question
































    0















    I'm trying to make an enum column validation in laravel. This is the code of my validator.



    /**
    * Returns the rules and messages for validating this creation
    */
    public static function ValidationBook($except = [], $append = []) string',
    'concert.user_id' => 'required


    The enum column is the type column. Also I've tried to do 'concert.type' => 'required|in:public,private'



    Then I create my Validator using the following code:



    $vb = Concert::ValidationBook($except, $append);
    $validator = Validator::make($data, $vb['rules'], $vb['messages']);


    But for some reason, when I send the post via Postman, i got "detail": "Undefined index: concert.type".
    Even when my data is:




    "concert":
    "title": "Title",
    "type": "novalidtype",
    "status": "open"




    Thanks in advance










    share|improve this question




























      0












      0








      0








      I'm trying to make an enum column validation in laravel. This is the code of my validator.



      /**
      * Returns the rules and messages for validating this creation
      */
      public static function ValidationBook($except = [], $append = []) string',
      'concert.user_id' => 'required


      The enum column is the type column. Also I've tried to do 'concert.type' => 'required|in:public,private'



      Then I create my Validator using the following code:



      $vb = Concert::ValidationBook($except, $append);
      $validator = Validator::make($data, $vb['rules'], $vb['messages']);


      But for some reason, when I send the post via Postman, i got "detail": "Undefined index: concert.type".
      Even when my data is:




      "concert":
      "title": "Title",
      "type": "novalidtype",
      "status": "open"




      Thanks in advance










      share|improve this question
















      I'm trying to make an enum column validation in laravel. This is the code of my validator.



      /**
      * Returns the rules and messages for validating this creation
      */
      public static function ValidationBook($except = [], $append = []) string',
      'concert.user_id' => 'required


      The enum column is the type column. Also I've tried to do 'concert.type' => 'required|in:public,private'



      Then I create my Validator using the following code:



      $vb = Concert::ValidationBook($except, $append);
      $validator = Validator::make($data, $vb['rules'], $vb['messages']);


      But for some reason, when I send the post via Postman, i got "detail": "Undefined index: concert.type".
      Even when my data is:




      "concert":
      "title": "Title",
      "type": "novalidtype",
      "status": "open"




      Thanks in advance







      laravel eloquent laravel-validation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 0:29







      Jacobo Tapia

















      asked Mar 27 at 0:23









      Jacobo TapiaJacobo Tapia

      4081 gold badge2 silver badges13 bronze badges




      4081 gold badge2 silver badges13 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          1














          Normally enum will be set in database like, and front end will be a drop down list



          $table->enum('concert_type', ['public', 'private']);



          However you can try out this solution



          'concert_type' => 'in:public,private', // Public or Private values






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55368058%2flaravel-how-to-validate-an-enum-column%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Normally enum will be set in database like, and front end will be a drop down list



            $table->enum('concert_type', ['public', 'private']);



            However you can try out this solution



            'concert_type' => 'in:public,private', // Public or Private values






            share|improve this answer





























              1














              Normally enum will be set in database like, and front end will be a drop down list



              $table->enum('concert_type', ['public', 'private']);



              However you can try out this solution



              'concert_type' => 'in:public,private', // Public or Private values






              share|improve this answer



























                1












                1








                1







                Normally enum will be set in database like, and front end will be a drop down list



                $table->enum('concert_type', ['public', 'private']);



                However you can try out this solution



                'concert_type' => 'in:public,private', // Public or Private values






                share|improve this answer













                Normally enum will be set in database like, and front end will be a drop down list



                $table->enum('concert_type', ['public', 'private']);



                However you can try out this solution



                'concert_type' => 'in:public,private', // Public or Private values







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 27 at 2:10









                Lim Kean PhangLim Kean Phang

                4003 silver badges6 bronze badges




                4003 silver badges6 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55368058%2flaravel-how-to-validate-an-enum-column%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현