paduraruionutandrei

paduraruionutandrei

Member Since 1 Year Ago

Experience Points
8,080
Total
Experience

1,920 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
70
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 2
8,080 XP
Feb
05
1 week ago
Activity icon

Replied to Company Schedule

Yes, I have something like this:

schedules (table) id company_id day interval 1 1 1(for Monday) 10 - 18(time interval)

So its ok ?

Activity icon

Started a new Conversation Company Schedule

Hello everyone, I have a little question about a database schema and my way to solve a certain problem.I have a business account and I need to let the user set up his schedule, for example I've done this database schema:

id - primary key day(day of the week) interval(working interval)

I will have for example: 1 Monday 9-18

Or I can split interval column into 2 column (startAt, finishAt) and set 9 as startAt and 18 as finishAt.

I need to show to principal view each company working interval.It's something wrong with they way I try to solve this problem.I will make 1-M relationship, but I think is a little bit redundant.

I need to show something like this: Monday 9 - 16 ... Friday 10 - 19

Thank you so much!

Jan
21
3 weeks ago
Activity icon

Started a new Conversation Store Form Input Into Database.

Hello everyone, I have a quick question about some Laravel code,

I have an offices table which stores some offices(for example: Cardiology, Neurology, etc.).I have a little problem, because each office when I add a new patient has some unique inputs like cardiology has EKG input(its a text input where the doctor insert some EKG values), and so on. I guess I need to store the inputs in some table. It is a good way or there is another way to do it.

Dec
06
2 months ago
Activity icon

Replied to Code Review

I implemented my own JWT Token authentication and everything, I just need to know If its a good practice to make relationships like I did.

Activity icon

Started a new Conversation Code Review

Hello everyone, this is a question is not for solving problems purpose, but to see if I am on the right way.I'm building an API for my first web app(I am a beginner) and try to write clean code(always find ways to improve my code, but doing my best).I have 4 models and their migrations for now, Company, Project, Bucket, Task.Everything in my app will be tied up to company, but I cannot figure it out If I do the right thing here.So here is my idea.I tied up Projects to company(one to many relationship), and then tied up Bucket to Project(one to many relationship again) and then Tasks to Buckets(again, one to many).

/**
     * Company projects
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function projects()
    {
        return $this->hasMany('App\Models\Project', 'company_id', 'id');
    }

    /**
     * project->buckets
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function buckets()
    {
        return $this->hasMany('App\Models\Bucket', 'project_id', 'id');
    }

    /**
     * bucket->tasks
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function tasks()
    {
        return $this->hasMany('App\Models\Task', 'bucket_id', 'id');
    }

Now my doubt is: When I add a middleware(like I said everything will be tied up to Company), for authorization purpose, another user will be able to access for example (/projects/1/bucket/1/tasks/1).And if it is a good way to do this, I mean I made something like a "stair".I tied up projects to companies, and then buckets to projects, and then tasks to buckets.

Sorry, If you do not understand my question.I am still a beginner and try to improve myself everyday!Thanks in advice!

Nov
28
2 months ago
Activity icon

Replied to JQuery Validator

@ravish I still don t get the error messages from the beginning.Here is the HTML(its a modal)

 <div class="modal fade create-category-modal" id="kt_modal_5" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-sm" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Add a new category</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    </button>
                </div>
                <div class="modal-body">
                    <form action="" method="post" class="attach-product-form" id="category-form">
                        @csrf

                        <div class="form-group">
                            <label for="message-text" class="form-control-label">Name</label>
                            <input type="text" id="name" name="name" class="form-control" placeholder="Enter category name" required autofocus/>
                        </div>
                        <div class="form-group">
                            <label for="message-text" class="form-control-label">Description</label>
                            <textarea class="form-control" name="description" id="description" cols="30" rows="10" placeholder="Enter category description"></textarea>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal" id="category-close">Close</button>
                    <button type="submit" class="btn btn-primary" id="create-category">Create</button>
                </div>
            </div>
        </div>
    </div>
    <!-- End create category modal -->
Nov
26
2 months ago
Activity icon

Replied to JQuery Validator

If I remove the event.preventDefault() is ok, the for is not submitted anymore but the error messages still does not appear.

Activity icon

Started a new Conversation JQuery Validator

Hello everyone, I have a big problem with some Ajax and jQuery validator plugin.Here is my problem, I try to validate some modals and still get some weird behavior. script:

<script>
$(function () {
$('#category-form').validate({
   rules: {
     name: {
      required: true
     },
       description: {
       required: false
     }
    }
  });
 });

$(document).ready(function () {
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('input[name="_token"]').val()
                }
            });

            $('#create-category').click(function (event) {
                event.preventDefault();

                $(this).attr('disabled', true);
                $(this).text('Processing...');

                if($('#category-form').validate().checkForm()) {
                    $.ajax({
                        type: 'post',
                        url: '{{ route('categories.store') }}',
                        data: $('#category-form').serialize(),
                        success: function (data) {
                            console.log(data)
                        },
                    });
                }
            });

            $('#category-close-update').click(function () {
                $('.update-category-form').trigger('reset');
                $('.modal-title').text('Add a new category');
            });
});

But is something weird with this code, it does not submit my form but the errors messages does not appear, only when I press "Create" then type something in input, then delete it so he could be blank(empty).

Weird call: https://imgur.com/a/32lBWS4

Thanks in advice for your help!

Nov
20
2 months ago
Activity icon

Started a new Conversation Stripe Payment With Laravel

Hello everyone, I have a little problem.I am trying to implement Stripe payment gateway using Laravel Cashier.I setup all the things, but something went wrong.

public function store(Request $request)
{
        $stripeToken = $request->get('stripe_token');

        $user = User::findOrFail(auth()->user()->id);

        $plan = 'enterprise';

        $user->newSubscription('main', $plan)->trialDays(5)->create($stripeToken);
 }

I try to make a simple payment, but the payment is successful and still get this error.

https://imgur.com/a/gbol7kL

The payment is canceled

Thanks in advice!

Nov
19
2 months ago
Activity icon

Replied to Ajax Modal Weird Error

I guess its from the http://localhost, its ok there.

Activity icon

Started a new Conversation Ajax Modal Weird Error

Hello everyone, I am stuck with some weird errors with Laravel modal and Ajax:

Ajax part: https://imgur.com/a/GWDah18 Modal: https://imgur.com/a/mUzUTl8 web.php: https://imgur.com/a/Z6fyCdw console.error: https://imgur.com/a/sGOdcRb

I do not know why is showing me this error, because the route type is the same in ajax call.

Nov
18
2 months ago
Activity icon

Replied to JQuery Validator And Laravel

Thank you for your answer, here is my .blade.php file, I have both id and name on input like in docs. https://imgur.com/a/EbT7uHX

Activity icon

Started a new Conversation JQuery Validator And Laravel

Hello everyone, I have a little problem with jQuery Validator and modals.Here is how I use the plugin:

But there is a little problem, the validation only works if I only tap something in the input box, if I press click on Submit, it still submit the form and show me this error: https://imgur.com/a/sOA44if I know its because of ajax, but the errors messages only appears if I tap something.

Nov
11
3 months ago
Activity icon

Replied to Laravel Cms

Thank you so much guys, I understand it.Thanks for your time!

Activity icon

Replied to Laravel Cms

I know, I use this editor too.But my question was this: How to generate pages with same layout and just let user fill the content of the page and title only.I already did the front end part using editor and all of those things, I am hard stuck on the back end thing, generate a .php file with the filled title by the user, then fill the page with WYSIWYG editor content, etc.

Activity icon

Replied to Laravel Cms

Just plain Laravel.Is not SPA App, just Laravel, HTML, Bootstrap, CSS and MySQL.

Activity icon

Started a new Conversation Laravel Cms

Hello everyone, greetings! :)

I work on a personal project to understand Laravel better, and I get stuck somewhere.I try to build a cms, a simple one with some functionalities like generate pages, categories, posts, etc. .I get stuck when I need to generate a new page, I dont have any ideea how to make it.

I need to generate pages like (contact page, idk something that user wants), I think all pages will share the same layout, but the only thing that user must complete is the title of the page and some content using a WYSIWYG, like wordpress.

Can someone help me with some ideas? Thanks in advice!

Oct
31
3 months ago
Activity icon

Replied to Laravel Authentication

Thank you for your answer, I will try your approach right now! Thank you so much! :)

Activity icon

Replied to Laravel Authentication

Thanks for your advice about sensitive date and your answer.So I have a user that have many employees(one to many relationship).So If I will be authenticated with an employee account that belongs to USER 1, I need to see only users 1 Orders and be able to edit them , and other actions!

Activity icon

Started a new Conversation Laravel Authentication

Hello everyone, I have a little problem with Laravel.I have 2 tables, users and employees, I try to make an authentication using both tables. https://imgur.com/a/3vRdGBa Another problem is that the employee should only visualize the users things that belongs to.

Thanks in advice!

Sep
24
4 months ago
Activity icon

Started a new Conversation Simple Smart Lists

Hello everyone, I want to create a smart list for my tasks.For example, I select some criteria and when I access that list, will gave me all tasks filtered by that criteria.I have a hard time trying to figure it out how to make it. Example: https://imgur.com/0FSpu6y Example 2: https://imgur.com/1bIc2Go

I 've made the migration, controller, service and model for the smart list, but I do not know how to start it, must be a relationship between smart list and task.

Thank you in advice for your help!

Aug
30
5 months ago
Activity icon

Started a new Conversation Monthly Chart

Hello, I want to create a yearly reports based on each month so I want to have something like this: Jan - 3 orders Feb - 4 orders I have an order_date column on my table, but I dont have any idea how to start, I just need an idea for the query, because I must have something like this I guess:

    {   
        "Jan" => 3,
        "Feb" => 4
        ....
    }

Someone can help me. I am using chart js and laravel.

Aug
29
5 months ago
Activity icon

Replied to Ajax Call Problems

Controller method: https://imgur.com/a/SijcW5V Response its empty object: https://imgur.com/vzTG6do

Activity icon

Replied to Ajax Call Problems

https://imgur.com/a/8sMKdIg , this is the response I got back from server side ( 200 OK ), but still undefined my responnse. The ajax call is made with success because my database change, and it adds the correct data, but something is wrong and I cannot access my data object.

Activity icon

Replied to Ajax Call Problems

That's the problem my response object is undefined when I try to access it in success function and I cannot figure it out why.

Activity icon

Started a new Conversation Ajax Call Problems

Hello everyone, I have a problem with ajax call.I have a call where I send some data to laravel backend, something simple.

$(document).ready(function () {
                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('input[name="_token"]').val()
                    }
                });

                $('#create-product').click(function (event) {
                    event.preventDefault();

                    $.ajax({
                        type: 'POST',
                        url: '{{ route('orders.attach-product') }}',
                        dataType: 'json',
                        data: $('.attach-product-form').serialize(),

                        success: function (response) {

                            let id = new Date().getTime();

                            let element = "<div> + ' + response.qty + ' + </div>";

                            $('#attach-products').prepend(element);

                            $('.attach-product-modal').modal('hide');
                            $('.attach-product-form').trigger('reset');
                        },
                        error: function (errorMessage) {
                            console.log('Error: ', errorMessage)
                        }
                    });
                });
            });

Everything works well, database get stored, but I cannot access data properties and I cannot create my dom element with data. Can someone help me please.

This is what I get: https://imgur.com/a/Ulq8iWh