Mego

Software Engineer at Kosice

Member Since 4 Years Ago

Svit

Experience Points
2,040
Total
Experience

2,960 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
17
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 1
2,040 XP
Sep
17
1 month ago
Activity icon

Replied to Condition Make The Operation After If() But Returns False

I am sorry, I have never heared anything about "void", I will try to google. Could you please provide me the exact code snippet for this try/catch? If possible, that the "error message" should pass to flash() function? I am just beginner. :-/

Activity icon

Started a new Conversation Condition Make The Operation After If() But Returns False

Hi guys, I have a condition like this

if(Mail::to('[email protected]')->send(new BugReport($validatedData))) {
                flash('Hlásenie o chybe bolo úspešne odoslané.Ďakujeme')->success();
            } else {
                flash('Chyba! Hlásenie o chybe sa nepodarilo odoslať. Skúste znova neskôr')->error();
            }
            return view('bug');

So I am checking, if e-mail was sucesfully sent, if yes, I am setting the success flash message, if not, I am setting error flash message. The problem here is, that I receive the e-mail, but I get error flash message. Why?

Activity icon

Replied to Creating Flash Message Engine

I have found something like this: https://github.com/laracasts/flash I will try it ;)

Sep
16
1 month ago
Activity icon

Started a new Conversation Creating Flash Message Engine

Hi guys again. In another topic you have adviced me about sending the e-mail. This thing works very good now, but I have a problem, when the e-mail is sent to address, I receive the blank page. I would like to redirect on "form" page, but show a flash message at the top of the page, How can I do that?

In my controller, there are two methods

  • index(), which only show the form to fill
  • report(), which will validate and authorize data and send an E-mail, based on "mailable" web template.

My report() function looks like this

public function report(ReportBug $request) {
        $validatedData = $request->validated();
        if($validatedData) {
            Mail::to('[email protected]')->send(new BugReport($validatedData));
        }

I suppose, the Mail::to... function should be in "if" condition and when true, I need to add some data to session, when false, I need to add another data to session. Then redirect to index() method with showing the flash message. How can I do that? Or is there the other engine to use? Thank you

Sep
14
1 month ago
Activity icon

Started a new Conversation Sending Data From Inputs To Mail

Hi, I am solving an issue about sending mail in Laravel (in Vanilla this is a job for a few minutes).

I have created a form BugReport, classic way - [email protected] and @report. @index will render the form, @report should process (so validate and authorize user's inputs) and send it to main application mail (so static mail address, not user's e-mail).

I have created a new Mailable by Artisan with a name "BugReport". However I really don't know how to pass data from inputs to it?

In my [email protected] I have something like this:

public function report(ReportBug $request) {
        $validatedData = $request->validated();
        if($validatedData) {
            Mail::to('[email protected]')->send(new BugReport($validatedData));
        }

and in my Mailable I have this:

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class BugReport extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct()
    {

    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->from('[email protected]')
            ->view('emails.bugreport')
            ->with([
                'data' => $validatedData,
            ]);
    }
}

However $validatedData doesn't exists in Mailable class. I know that not, but I would like to ask how to do, desired data will be in Mailable? I have prepared them in BugReportController.

Thank you

Activity icon

Replied to 403 Error After Validating Form

Yes friends, I've got it. It works, thank you

Sep
13
1 month ago
Activity icon

Replied to 403 Error After Validating Form

This function should be placed in app/requests/myfile.php? Or where? :-)

Activity icon

Started a new Conversation 403 Error After Validating Form

Hello. I have created a form in one of my something.blade.php. The form has no action, this is solved by routes/web.php (Route::get render form and Route::post should process the form).

I have really followed the documentation steps, I have created a new file in App/Requests/ReportBug.php via php artisan command Then I have fullfiled some validation rules. In the controller I wrote a "hint to request", like

public function report(ReportBug $request) // ReportBug is a name of app/requests/file

And then copy/pasty the validation statement from docs

$validated = $request->validated();

Also there is var_dump($validated); after that (cause I would to know what is in $validated variable). When I fill the form on front-end and push the submit button, I received Forbidden, 403 This action is unauthorized.

Why?

Activity icon

Replied to Verification Mail Doesn't Work

Oh yes, do you think so? I will try

Activity icon

Started a new Conversation Verification Mail Doesn't Work

I have a register system with verification e-mail. Everything seems to be OK, when I register, I received the e-mail with verification button and link. When I click that button, or verification link, nothing happened. New card in browser is open with a link on "log-in form". The database column is still NULL

When I try to login, I receive a flash message, that my e-mail is not verified. I click the "Send new verification mail", I receive the email, and in this - second e-mail is button and link working good.

So when I want to verify e-mail, the first time doesn't work, but when I resend the email, it works. Where should I search problem? Laravel 6

Sep
12
1 month ago
Activity icon

Replied to Insert A Row When No Columns Are Defined

I will have about 40 tables. Thats unimaginable to set nullable to all columns

Activity icon

Replied to Insert A Row When No Columns Are Defined

I am not using migrations, I have clicked out whole database structure in phpmyadmin.

I can simply add default value, but it is not efficient, I think...

Really is here no another way?

Activity icon

Started a new Conversation Insert A Row When No Columns Are Defined

I have a table user_profiles, which contains user_profile_id, user_id, birthdate, profile_image... 10 columns alltogether. In one place of my application, I need to create a row for new user in this table, but with only "user_id" column, I don't want to define the others columns and I would like to let them blank. Howeve, I am getting this error:

SQLSTATE[HY000]: General error: 1364 Field 'profile_image' doesn't have a default value (SQL: insert into user_profiles (user_id) values (27))

I need only to create a row with user_id (and primary key user_profile_id of course), and let the others column blank. How can I do that and remove this error? I don't thnik, it's good practise to write down each column and set it to null

My code looks like:

DB::table('user_profiles')->insert( [ 'user_id' => $newUserId->id, ] );

I tried to google and I google something about strict trans table, or something like this... however I try to turn it off and it was succesfull, however the error is still there. Database is MySQL 5.6 with MyIsam engine

Thanks for help

Activity icon

Replied to Set A E-mail Client For WAMP

Hey bro, now it WORKS! Thank you a million, you save my day.

Activity icon

Replied to Set A E-mail Client For WAMP

This is from phpinfo();

SMTP localhost localhost smtp_port 25 25

I didn't know that I must clear cache bro, you have not mentioned about it... :( I am going to try it

Sep
11
1 month ago
Activity icon

Replied to Set A E-mail Client For WAMP

Still does not work. I tried another port... nothing, still the same error.

Sep
10
1 month ago
Activity icon

Replied to Add My Own Custom Action After User's Registration

I am lost in documentation now bro :-/ I tried to follow steps in doc, I have written my custom code to $listen in EventServiceProvider(AppqListeners\MyListener) and run php artisan event:generate However I can't see the "events" folder in my App...

What did I wrong?

Activity icon

Replied to Add My Own Custom Action After User's Registration

So I should write my own "DoMyCustomStuff::class" into the "Registered::class" array, correct?

In my case, this will be CreateUserProfile::class, but what's next? I will create a new public function in App/User.php model, how can I call this function from event service provider?

Sep
07
1 month ago
Activity icon

Replied to Set A E-mail Client For WAMP

Hello, I have tried this, but still the same error. :(

Sep
06
1 month ago
Activity icon

Replied to Set A E-mail Client For WAMP

Hi, this is enough for mailing from localhost? I will try in a few hours

Activity icon

Replied to Add My Own Custom Action After User's Registration

Friend, does it works in Laravel 6 too?

Activity icon

Started a new Conversation Add My Own Custom Action After User's Registration

I have done the user's registration process. Now I would like to add custom "action" after user registration. When user is registered, the new row in table "users" will appear. I would like to add there an action, that also new row will appear in "user_profiles" table (my custom table). I suppose, the "insert" query should be stored in App/User.php model, but where should I call this function, to be sure, the new row will be created?

Sep
05
1 month ago
Activity icon

Replied to Editing View Of Verify E-mail

Thank you bro, this is what I have absolutely needed ;)

Activity icon

Replied to Editing View Of Verify E-mail

Bro, this is view of a screen, which is next after the register. I have updated that site yet, but e-mail template is something different.

Activity icon

Started a new Conversation Editing View Of Verify E-mail

Hello. I have need to edit content of verification e-mail, which is sending after the registration of fresh user. I found via Total Commander, the file is situated on this address:

/vendor/laravel/framework/src/Illuminate/Notifications/resource/views/email.blade.php

My opinion is, that is not good practise to edit anything in /vendor/ folder. What should I do?

Activity icon

Replied to Public/js And Css Folder Sudennly Disappeared

Yes, but I have not that versions. :-/

Activity icon

Replied to Public/js And Css Folder Sudennly Disappeared

What to do if I don't have and don't want to have and use npm? I don't need it :-/

Activity icon

Replied to Public/js And Css Folder Sudennly Disappeared

So I just need to use Laravel Mix for compilation and it will be OK? Could you plz give me more info about what should I write to console?

Activity icon

Started a new Conversation Public/js And Css Folder Sudennly Disappeared

I have developed a small system on my localhost, using WAMP. Everything went OK. Then I manually uploaded the file from my wamp/www/project to FTP - live server. When I try to run an application, the CSS and JS files are not available.

I have looked into the ftp and find, that there are no css and js folder in public/... why? Also the next mystery is, on my localhost those folders seems to work fine (probably laravel cache?), but when I look via file explorer, I can't find both folders...

What's the magic? I would like to find default js and css files distributed with laravel package. I looked also to Laravel's github repository, folder are gone... What should I do?

Activity icon

Replied to Send Emails With Gmail In Laravel

Hello there. I tried to set an e-mail on WAMP by your orders, but it doesn't work :( I still get an error

Swift_TransportException Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required "

Did some change during ages?

Activity icon

Started a new Conversation Set A E-mail Client For WAMP

I am trying to send an verification e-mail from my localhost (WAMP server on 127.0.0.1). I have downloaded this utility: https://toolheap.com/test-mail-server-tool/ Now when I try to send the php mail() function, the e-mail is OK, but when laravel tries to send an e-mail, I receive the error

Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required " What should I do? Thank you

Sep
04
1 month ago
Activity icon

Replied to Disabling Auto Login User After Registration In Laravel 6

Yep, it works ok now. Thanks a million. I am just starting with laravel and have no experience with another FWs. I used to work with own MVC.

Activity icon

Replied to Disabling Auto Login User After Registration In Laravel 6

The fresh user has got to the database, thank you. But after everything ends, I have got an error

Class 'App\Http\Controllers\Auth\Registered' not found

Activity icon

Started a new Conversation Disabling Auto Login User After Registration In Laravel 6

I am trying to disable auto login of fresh user, after registration. I found a function in trait /vendor/.....RegistersUsers.php on line 60

$this->guard()->login($user);

I don't think, that changing anything in vendor folder is good practise, so I tried to override protected function registered(...) in my app/http/controllers/auth/RegisterController.php

protected function registered(Request $request, $user) { event(new Registered($user));

    //$this->guard()->login($user);
}

But when I run this code, I receive the error

Argument 1 passed to App\Http\Controllers\Auth\RegisterController::registered() must be an instance of App\Http\Controllers\Auth\Request, instance of Illuminate\Http\Request given, called in C:\wamp\www\myproject\vendor\laravel\framework\src\Illuminate\Foundation\Auth\RegistersUsers.php on line 35

How can I disable this "feature"?