Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

ignisrzeus

ignisrzeus

Member Since 2 Years Ago

Experience Points
2,860
Total
Experience

2,140 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
0
Lessons
Completed
Best Reply Awards
2
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 1
2,860 XP
Nov
04
3 weeks ago
Activity icon

Replied to Ignore Mutator If Model Is Being Seeded

Unfortunately did not work. I instead used some conditionals to fit the needs of my application. It's now working. Thanks for the help!

Oct
31
3 weeks ago
Activity icon

Replied to Ignore Mutator If Model Is Being Seeded

However, the mutator was in fact ignored (I know this because the error message showed the right data to input in the field where I dont want the mutator to take effect). But again, my json columns won't be populated because of the said error message.

Any help will be greatly appreciated. Thanks!

Activity icon

Replied to Ignore Mutator If Model Is Being Seeded

If I use a normal create in my seed file, my json fields get populated without a problem. However, when using the setRawAttributes, an error "Object of class stdClass could not be converted to string" appears whenver the json column is being filled.

Activity icon

Replied to Ignore Mutator If Model Is Being Seeded

@michaloravec Thanks for the response! I'm having a "Object of class stdClass could not be converted to string" in all of my json fields. Why is this the case?

Oct
30
4 weeks ago
Activity icon

Started a new Conversation Ignore Mutator If Model Is Being Seeded

Good Day Laracasts!

Would just like to know if there is a way to tell Laravel that during seeding, do not apply setSomethingAttribute. I'm aware that I can do some conditional statements in the mutators, which is why I would like to know if there is a way to know if the Model is being filled using a seed or not. On the other hand, maybe there's a factory/seed function that I may use to ignore mutators altogether similar to factoryWithoutObservers.

Thanks for the help Laracasts!

Oct
24
1 month ago
Activity icon

Replied to Laravel Notification One Notification Is To Many Users

@snapey Thank you for your response. Would this mean that I would rather create a Tasks table instead of modifying the Notifications table? Thanks!

Oct
23
1 month ago
Activity icon

Started a new Conversation Laravel Notification One Notification Is To Many Users

Good Day Laracasts! I was wondering what are your thoughts of what I am trying to accomplish with Laravel Notification.

I added a column to the notifications called "accomplished_at", where if a certain action is completed, the notification will "disappear" for the user as it also behaves like a "To Do List" for the user.

Example: If a user is notified that he will be needing to "review" a certain model, the notification will be displayed in his to do list, and if he is able to review it, the column "accomplished_at" will now include a date. Hence, since it has a date, it is marked as a task that is "finished" and will no longer appear in his to do list.

It makes sense for a One User is to One Notification, however, things get a little bit tricky when the notification is sent through multiple users.

Example: If 5 users can "review" a certain item, the way it works is that they do not have 5 individual items to review. Instead, they can all review the same item, but if one of them has successfully reviewed it, it is expected that the notification will be "accomplished" for everyone, even though only one of them has actually "reviewed it".

Now my question is, is what I am trying to achieve feasible? Im hoping someone can give me advice regarding this matter. Laravel Notification by default creates an entry for each notification sent to each user. If I am somehow able to create only 1 notification for every action (regardless of how many users will receive it), that would be extremely helpful as I can easily accomplish this. Maybe if I am somehow able to make the notifiable_id an array, so that User 1 and User 2 can refer to the same notification and still receive the notifications in their to do list, maybe I can make this work. However, I'm not sure how I can make this work myself.

Hoping I'm making sense with what I am trying to achieve here. Thank you in advance, Laracasts!

Jul
09
4 months ago
Activity icon

Awarded Best Reply on How To Make Recursive Calling Of Subitems In Vuejs2?

Hi! Here's an excellent example of handling Recursive Components in VueJS

https://alligator.io/vuejs/recursive-components/

This covers everything you need. Cheers!

Jul
08
4 months ago
Activity icon

Replied to How To Make Recursive Calling Of Subitems In Vuejs2?

Hi! Here's an excellent example of handling Recursive Components in VueJS

https://alligator.io/vuejs/recursive-components/

This covers everything you need. Cheers!

Activity icon

Replied to Laravel Passport How To Logout User?

Have you checked if the user has multiple tokens? Because it is possible.

        $request->user()->tokens->each(function ($token, $key) {
            $token->delete();
        });

Will delete every user's token. Hope this helps.

Activity icon

Replied to Get Websocket Data In Laravel Controller

I'm not sure myself if you can directly do this. However, you can simply call an ajax request when your receive the data from the websocket link, then pass the received data thru ajax so that you can use the data in the controller.

Jul
03
4 months ago
Activity icon

Replied to Access Denied For User 'forge'@'localhost' (using Password: YES)

I see. I'm seeing some related issues regarding Laravel Forge not retrieving the correct .env file. Could this be related to my issue?

Can't seem to move forward because of this dilemma. Any additional help would be amazing. Thanks!

Jul
02
4 months ago
Activity icon

Replied to Access Denied For User 'forge'@'localhost' (using Password: YES)

Hi! I'm completely lost here. I'm very sorry for being clueless about Laravel Forge. Few questions here

  1. When Enter Password prompts in:
[email protected]:~$ mysql -uforge -p
Enter password:

What password should I input? From my understanding, I am supposed to input the DB_PASSWORD under the .env file -- which is the same password that is emailed to be by Laravel Forge.

  1. In relation to 1, when prompted for the password of root, I do not know what I am supposed to input. I checked my email, and I did not receive a password for root unfortunately.

Here's a sample of the email I got from Laravel Forge

Name:	SomeWebsiteName
IP Address:	SomeIPAddress
Username:	forge
Sudo Password:	SomeSudoPassword
Database Username:	forge
Database Password:	SomeDBPassword

This is the only email I received that has a password inloved in it.

Hope this helps clarify things. Thanks!

Activity icon

Replied to Access Denied For User 'forge'@'localhost' (using Password: YES)

Hi! Thank you for the response!

I checked my database users and confirmed that Laravel Forge created user "forge" right away after creating the "forge" server.

And also, i can confirm that user "forge" exists because I was able to access the database via SSH. My terminal now starts at:

[email protected]

My problem occurs when entering the DB_PASSWORD, it seems as if it the .env is not reflecting the correct DB_PASSWORD unfortunately.

[email protected]:~$ mysql -uforge -p
Enter password:
ERROR 1045 (28000): Access denied for user 'forge'@'localhost' (using password: YES)

If i am assuming the wrong things, I apologize in advance as I am new to deploying Laravel Applications. Hopefully I made sense. Thank you!

Activity icon

Replied to How To Input Into Array As Numbers

Hi! There's so much optimizing here in your code. This is not the "Vue" way to do this, as you can simply have a v-model for each totalScore and bind it to each via index (totalScores[score_index]) or something along those lines. I can help you design the form for that, but here are some quick fixes for you:

  1. A reason why your values are behaving like strings is because you used value=1, value=2 and so on and so forth. What you should have instead used is
   <td class="text-center" style="vertical-align: middle;">
                            <input type="radio" @change="onChange($event, index)" :name="question.name" :value='3'>
                        </td>

Take note of the change from

value=3 ----------> :value='3'
  1. If the problem persists, then simply your strings to numbers using parseInt!
    onChange(event,index) {
              let data = parseInt(event.target.value);              
              Vue.set(this.totalScores, index, data);             
          }

This is a quick fix, but you should look into properly binding your forms into v-models! You can ask questions here if you want to do this the "Vue" way.

Hope this helps!

Activity icon

Replied to Laravel 7 Add Checks Before FormRequest Validation

Hi! I'm not sure exactly what you're asking, but if you simply want to validate your form whether to push or not, you may use Laravel's validate function

public function store(Request $request)
{
    $validatedData = $request->validate([
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
    ]);
}

In your case, if I understood your question correctly, something like this should do the trick

public function store(Request $request)
{
    $validatedData = $request->validate([
        'products' => 'required',
    ]);

// If products is not null, do rest of the code below...
}

Here's a link for everything about validation in Laravel! https://laravel.com/docs/7.x/validation

Hope this helps!

Activity icon

Started a new Conversation Access Denied For User 'forge'@'localhost' (using Password: YES)

Good Day Laracasts!

Today is my first time deploying a website via Laravel Forge. I've been following BitFumes' guide on how to deploy a laravel app via Forge, and everything has been working fine up until the database connection.

I have successfully logged in via SSH in my database, but whenever i run

mysql -uforge -p

I always get the result:

Access denied for user 'forge'@'localhost' (using password: YES)

The password that I input is the one that is located in the .env file in the Laravel Forge Environment section.

Currently stuck as i cannot successfully access my database because of this dilemma.

As of the moment, I'm not sure what I need to show you guys, but i simply named my database "forge" and didn't change anything as of the moment as i tried to strictly follow BItFumes' guide.

However, these are crucial files that I think are related to my dilemma:

database.php

'mysql' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

config\app.php

 'key' => env('APP_KEY'),

.env

APP_NAME=Laravel
APP_ENV=production
APP_KEY=base64:Jihb8EG1he78Cv5ZhG8CRxAfyic3bWm+FetJbXWTqPg=
APP_DEBUG=false
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=forge
DB_USERNAME=forge
DB_PASSWORD="somerandomgeneratedpassword"

As I have stated above, I copy and simply paste "somerandomgeneratedpassword" (Obv. a placeholder) in the password section when being asked after running "mysql -uforge -p".

Any help will be greatly appreciated. Thank you very much!

May
22
6 months ago
Activity icon

Awarded Best Reply on Mood Off ! What You Do When It Happen?

Best advice I can give you is that If you're not feeling like doing it right now, then just simply don't do it -- only if you are confident you can accomplish it the next day. Coding is such a momentum based activity. If you don't have the momentum, you'll just be distracted all the time and end up doing little to no work.

However, if you do need to accomplish it right away, then just think about the satisfaction of finishing a module and your reward from it (may it be financial, grades, or whatever). Just remind yourself all the intrinsic and extrinsic rewards that you will get from accomplishing the module and you'll be grinding again in no time :)