Laravel 6 Beginner - e18 - Final Project Part 2 (Questionnaire/Survey App)

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • For a final project on this course, let's build an App for creating questionnaires (surveys). In part 2, we are answering one of the most frequent questions that I get, how to save from 1 form to multiple tables at once.
    For the best experience, follow along in our interactive school at www.coderstape...
    DigitalOcean Referral
    m.do.co/c/7dce...
    About This Course
    If you have been looking to learn Laravel, there hasn't been a better time. The framework reached an important point in its life, with the release of Laravel 6. There has never been more demand for Laravel developers than now. In this series, we are going to get you started in your path to becoming a Laravel Artisan. Let's get right to it!

Комментарии • 62

  • @noorahmed5115
    @noorahmed5115 4 года назад +5

    You deserve millions of subscribers

  • @daviddeleon3411
    @daviddeleon3411 4 года назад +6

    Not because im not following this series it means that i dont want your content.. It means that because of your previous tutorial. I can now do some application alone :) Thank you so much Sir :)

    • @caspianfox6596
      @caspianfox6596 3 года назад

      i guess it's pretty off topic but does anyone know of a good place to watch newly released series online ?

    • @armanidavis2843
      @armanidavis2843 3 года назад

      @Caspian Fox Try FlixZone. You can find it on google =)

    • @dillonrory2038
      @dillonrory2038 3 года назад

      @Armani Davis Yea, I've been watching on flixzone for years myself :)

    • @caspianfox6596
      @caspianfox6596 3 года назад

      @Armani Davis Thank you, I signed up and it seems like they got a lot of movies there :) Appreciate it!

    • @armanidavis2843
      @armanidavis2843 3 года назад

      @Caspian Fox no problem xD

  • @saadsaif97
    @saadsaif97 3 года назад

    passing from form as:
    $questions['question'] = 'ding';
    $answers[]['answers'] = 'first';
    $answers[]['answers'] = 'second';
    $answers[]['answers'] = 'third';
    $answers[]['answers'] = 'fourth';
    which results in:
    //questions
    Array
    (
    [question] => ding
    )
    // answers
    Array
    (
    [0] => Array
    (
    [answers] => first
    )
    [1] => Array
    (
    [answers] => second
    )
    [2] => Array
    (
    [answers] => third
    )
    [3] => Array
    (
    [answers] => fourth
    )
    )

  • @maamun79
    @maamun79 4 года назад +1

    Can you do a video with laravel and ajax combined??

  • @mostafamosavi7362
    @mostafamosavi7362 4 года назад +1

    please make a video about vue + laravel from scratch

  • @shekhsaifuddin1353
    @shekhsaifuddin1353 4 года назад +2

    Great video ever, it has lot of content....

  • @its.james.miller
    @its.james.miller 3 года назад

    This one really bugs me. @06:49 you are using the following in the url {{ $questionnaire->id }} - and this gives me an error under Laravel v8.40.0 (PHP v7.3.5). Now when I switch and use only one curly brace, the error goes away and the site is just working fine. I mean like this: { $questionnaire->id }. What did I miss...?

  • @noorahmed5115
    @noorahmed5115 4 года назад +3

    Brilliant Tutorial.
    I do have 2 questions:
    Why not used short named routes instead?
    For the question input in the form, why making it an array, why not simply name it to question instead of question[question]?

    • @CodersTape
      @CodersTape  4 года назад +1

      Using routes because this is a beginner level and I want it to be obvious what the route is. Named routes are not obvious where they’re going.
      You could use question only but then you would have to wrap it in an array with the key of question or do something like Arr::only(). Give it a try and you’ll see what I mean.

    • @noorahmed5115
      @noorahmed5115 4 года назад

      @@CodersTape Thanks dear. Got the idea.

    • @itsumarejaz
      @itsumarejaz 4 года назад

      @@CodersTape Why do we need to wrap question in an array when there is only one question. In the former part of the playlist when we created service we just needed its name and we didn't create an array to store it in database. Please Explain.

    • @Knee-Lew
      @Knee-Lew 4 года назад +1

      @@itsumarejaz to make storing data easier and cleaner to code, as the array consists of respective table (i.e. ['question'] for Question model) for storing data.

  • @prospermaseko2280
    @prospermaseko2280 4 года назад +1

    interesting but i see that i have to slow down my pace as its beginning to be deep a bit by bit. Good work Coder'sTape....capital 'C' for controller kkkk

  • @Adbal99
    @Adbal99 4 года назад +1

    Soo.. input name in blades is a value passed from migration tables or even whole schemas (i am about schema named "answers")? Am i right?

    • @CodersTape
      @CodersTape  4 года назад +1

      If you follow that pattern than it certainly makes writing the code much easier.

    • @Adbal99
      @Adbal99 4 года назад

      @@CodersTape yup, I see it's very helpful. Thanks man!

  • @Blendermasterhacks
    @Blendermasterhacks 3 года назад

    Is there a way to add choices as we need not only 4 choices🙄🤔

  • @mylastreply3542
    @mylastreply3542 4 года назад +1

    i have some trouble with required answer field when i submit form even though i put value all field its always required?

    • @mylastreply3542
      @mylastreply3542 4 года назад

      at 19:33 when i dd($data) the answer not show? how i fixed it. even the views has the same code

  • @pramod9200
    @pramod9200 4 года назад +1

    what I miss?? I am getting Integrity constraint violation: 1048 Column 'questionnaire_id' cannot be null error

  • @rishibhusal9169
    @rishibhusal9169 4 года назад +1

    nice video victor bro !! love you

  • @poldohub5275
    @poldohub5275 4 года назад +1

    Thank you so much. I'm a big fan of yours 😉😁

  • @jahanzebjozy
    @jahanzebjozy 3 года назад

    I do have a question. How can we perform an update in this questions table along with answers?

  • @fachriakbar6880
    @fachriakbar6880 4 года назад

    18:54 i don't get a blank page. Why? My questionare view look like array 15:47 can you help me ?

  • @yasserakbbach7342
    @yasserakbbach7342 4 года назад

    Why don't you create a paid Udemy course?!
    e.g: The complete laravel handbook

  • @vasanthii3977
    @vasanthii3977 4 года назад +1

    Thank you sir,
    how can i solve my "Call to a member function create() on null "error?

    • @richardbernisca1427
      @richardbernisca1427 4 года назад

      I got this error too. How did you solve this?

    • @chenindra9070
      @chenindra9070 3 года назад

      @@richardbernisca1427 Maybe u can check the defined relationship on each model, make sure it was correct with have "return" on it. Just follow the video exactly. should be correct

  • @cubedev4838
    @cubedev4838 4 года назад

    Amazing channel!! Can u build wordpress clone?

  • @shahadat015
    @shahadat015 4 года назад

    Really awesome tutorial. But I have a question that what if I want to update in has many relationship. I couldn't find any method for update. Can you help please. Thanks.

  • @AshishKashyap-zq8ws
    @AshishKashyap-zq8ws 4 года назад

    Hello Sir
    plz make a big project on laravel 6 like you had made a tutorial dummy instagram project on freecodegram.
    Thank you

  • @sezohessen7485
    @sezohessen7485 4 года назад

    In this video you write for your self. a lot of explanations missed

  • @HanLynnKyaw
    @HanLynnKyaw 4 года назад

    This is quite wonderful . This perhaps could be considered as one of the options to implement a double entry accounting system with nested account codes.

  • @edgargonzalez847
    @edgargonzalez847 4 года назад

    Thanks for the videos, you're a great teacher :) Only have a one question... How I save one image using laravel storage? Already create variable question[image] in the store method, but when push the image, dd show me "Null"... Help :(
    Sorry for my bad english.

    • @alienheartz9163
      @alienheartz9163 4 года назад

      Make sure that your form has enctype="multipart/form-data"

  • @javiercedeno4033
    @javiercedeno4033 4 года назад

    this series is very interesting, like the explanation, now
    Why not make an invoice project?

  • @richardbernisca1427
    @richardbernisca1427 4 года назад

    Im getting this error : "Call to a member function create() on null"

  • @zeydduran
    @zeydduran 4 года назад

    I don't know the exact your language but, everything is beautiful.

  • @zhasan66
    @zhasan66 4 года назад +1

    Very nice video tutorial.

    • @LiLoBiY
      @LiLoBiY 4 года назад

      Тест

  • @bashardlaleh2110
    @bashardlaleh2110 4 года назад

    thanks dude but Zoom in a little :)

  • @CarryShout91
    @CarryShout91 4 года назад

    Are you planning to do more advanced laravel tutorials in the future? :)

  • @AvinzVector
    @AvinzVector 4 года назад

    17:01 the validation are not working. i left the form empty and hit submit, yes its not going anywhere its just refreshing the page. but its not showing any error message. i mstuck here

    • @AvinzVector
      @AvinzVector 4 года назад

      i solved it by adding ' @error('question.question') is-invalid @enderroron ' the input class. how could you do it without that ?

  • @mustafayosoufi3956
    @mustafayosoufi3956 4 года назад

    when i am trying to save the answers give this error Undefined index

    • @Knee-Lew
      @Knee-Lew 4 года назад

      Undefined index: 'answers', right?
      check your name attribute in your blade file. Or try dd() to figure it out what's wrong.

  • @itsumarejaz
    @itsumarejaz 4 года назад

    Sorry if this has been answered before. I'm following along the course but here I stuck with one question which is Why we need to make an array of question as we know there are can only be one question. I understand the need of array for answers as there can be four possible answers. Why do we need an array for question?

    • @CodersTape
      @CodersTape  4 года назад +2

      Because we’re trying to encapsulate the question form fields. Presumably there could be multiple form elements inside and we just want a “grouping” of question fields.

    • @itsumarejaz
      @itsumarejaz 4 года назад

      @@CodersTape but Sir there is only one question form "field" not multiple question form "fields".

    • @itsumarejaz
      @itsumarejaz 4 года назад

      So the reason I understood for creating an array for single question is that as we need to store data in two different tables i.e. questions and answers while hitting a single store method in QuestionController and we are passing data through $data variable which contains an associative array with two keys "question and answers" which further contain associative array of "question" and "answer" respectively. We passed $data['question'] in create() function which means whatever value $data['question'] has if it is similar to the column name of the respective table, a new record in that table will be created. As $data['question'] contains a sub-array with $key "question" which is similar to the column name in questions table, so boom, it will add new entry to questions table. Same goes for the array of answers. So it makes sense to pass $data['answers']. Note: If the $key names are similar to the column name in database then it is easier to store data in laravel.

  • @alvinkariuki236
    @alvinkariuki236 4 года назад

    Thanks a lot, your best practices are top tier