Mego

Member Since 4 Years Ago

Svit

Software Engineer at Kosice

Experience Points 1,920
Experience Level 1

3,080 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.

14 Sep
2 days ago

Mego 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

Mego left a reply on 403 Error After Validating Form

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

13 Sep
3 days ago

Mego left a reply on 403 Error After Validating Form

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

Mego 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?

Mego left a reply on Verification Mail Doesn't Work

Oh yes, do you think so? I will try

Mego 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

12 Sep
4 days ago

Mego left a reply on Insert A Row When No Columns Are Defined

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

Mego left a reply on 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?

Mego 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

Mego left a reply on Set A E-mail Client For WAMP

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

Mego left a reply on 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

11 Sep
5 days ago

Mego left a reply on Set A E-mail Client For WAMP

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

10 Sep
6 days ago

Mego left a reply on 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?

Mego left a reply on 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?

07 Sep
1 week ago

Mego left a reply on Set A E-mail Client For WAMP

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

06 Sep
1 week ago

Mego left a reply on Set A E-mail Client For WAMP

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

Mego left a reply on Add My Own Custom Action After User's Registration

Friend, does it works in Laravel 6 too?

Mego 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?

05 Sep
1 week ago

Mego left a reply on Editing View Of Verify E-mail

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

Mego left a reply on 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.

Mego 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?

Mego left a reply on Public/js And Css Folder Sudennly Disappeared

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

Mego left a reply on 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 :-/

Mego left a reply on 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?

Mego 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?

Mego left a reply on 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?

Mego 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

04 Sep
1 week ago

Mego left a reply on 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.

Mego left a reply on 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

Mego 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"?

15 Jul
1 year ago

Mego started a new conversation How To Do A Difficult Routes?

I am creating something like very simple personal CMS. I have the admin section, hardcoded in the routes/web.php file. That's no problem, everything goes fine (except 404 page, which I'm working on at the moment). But I have a problem with basic front-end routes. The system is like this: The admin will create a new subpage, it will name it and assign a module (module could be for example articles, contact-form, gallery, static page, etc.). This will be stored to a database's table. To this point everything is OK for me. The problem is, I need to select the data from the database's table and create the routes from them. And this is problem. Is OK to use DB::class in routes/web.php? I think not, because of MVC. The main reason, why the subpage's name can't be hardcoded in a web.php file is, that I have no chance to know, how the admin will name the subpage. For example, the article module could be named as "Articles", or "News", or "Blog", so I can't write something like Route::get('News', '[email protected]'); :-/

I thought about two ways:

  1. Use DB::class directly in routes/web.php file. Something like this: $dynamicRoutes = DB::table('structure')->select()->join('modules', 'structure.module_id', '=', 'modules.module_id')->get(); //var_dump($dynamicRoutes);exit; foreach($dynamicRoutes as $route) { eval "Route::get('/".$route->structure_url."/', '".ucfirst($route->module_url)."[email protected]');"; } The problem is, that I always received the syntax error, I really don't know why (something wrong here: Route::get('/"' (T_CONSTANT_ENCAPSED_STRING), expecting '(')

  2. Define everything hardcoded routes (so routes for admin section) and each other url, which will be not defined, will point to "[email protected]", there I am able to process the URL. But, there's a problem. If I set something like Route::get('/{slug}', '[email protected]') it's working very fine for www.sitename.com/example. But not worked for www.sitename.com/example/2. How can I secure, that everything else, as defined will be point to [email protected]?

Thank you for a help

04 Feb
1 year ago

Mego left a reply on How To Get Current Url Path

Guys, is there available another methods on function url()? Or just current()? It's because I need to get almost full URL, but without ending {slug} and I don't know how.

02 Feb
1 year ago

Mego left a reply on How To Install CKeditor On Laravel 5.2

Hello. I have installed ckeditor viac composer, but I'm afraid, that nothing happend. Nothing appeared in my code (I think there's no way to ckeditor.js file etc.) and textarea still looks barely, even I add a class ckeditor

28 Jan
1 year ago

Mego left a reply on Edit Middleware To Advanced Check + Login By Nickname Instead E-mail

Where should I put this file? This code is completed, or I need to add something to //Admin-only routes ?

Mego started a new conversation Edit Middleware To Advanced Check + Login By Nickname Instead E-mail

Hello. I'm using this code snippet $this->middleware('auth'); in controllers in method __construct to secure, that guests can't enter the controller (only logged user can). I need to find this method and update it. In my app, I need to have more user roles, stored in database like INT (0-3). Only admins should have access to some parts of app, so I need to update this middleware to secure, that only logged users with role == 3 could access the controller. How can I do it?

The second thing - I would like to make user login by nickname (table users->name), instead e-mail. Is there any simple way how to do it? Thank you

19 Dec
1 year ago

Mego started a new conversation How To Get A Slug To Controller

Hello there. I have some problem with slugs. I have one controller "StaticController". I would like to point all static subpages to this controller. There, I will search the row in a DB and print the content. That's all. My problem is, that I'm seeking for a variable, which I can use inside controller and It would contain slug. For example, when I'm on subsite "contact", the value of variable should be "contact". When I'm on subsite "faq", the value of variable shold be "faq". Is there any variable, which I can use by this way? Or how can I get a slug into controller? I have about 12-13 static subsites, so it would be very stupid to create own controller for each static subsite...

Mego started a new conversation Yelds And Sections

I have a problem with "including" site parts to the main content. I have splitted the whole template to parts/header.blade.php parts/footer.blade.php etc. There in each file I have the "@section(header) etc. How can I include this parts to the main content blade? I tried yeld and extends, but doesn't work :(

24 Oct
2 years ago

Mego left a reply on Add Additional Information To User

Not bad idea... but I think that's not good...

Mego left a reply on Add Additional Information To User

And how can I do that? Where can I find the main database query to retrieve user by email and password?

Mego left a reply on Add Additional Information To User

So you think it's necessary to use new controller for user_profiles?

Why have you wrote there

public function profile()? From where do you have that word "profile". Shouldn't it be user_profile? Or user_profiles?

23 Oct
2 years ago

Mego started a new conversation Add Additional Information To User

Hello to all. I have a little problem and I would like to get help from you. I need, to do something like this:

If I write var_dump(Auth::user()) I will receive information about user from table "users". However, in my project, each user has a row in table called "user_profiles". I would like to get information from both tables to Auth::user(), so I can use for example datebirth of user everywhere in project. I need to do it via Auth::user(). How is it possible?

Please, without relations... I really don't need a new controller for user profiles... Is it possible?

02 Jun
4 years ago

Mego left a reply on PHPUnit Can't Connect The Oracle DB

But I'm really sure, that Yajra works properly, cause on production everything is OK

Mego started a new conversation PHPUnit Can't Connect The Oracle DB

I have migrated all the MySQL data to SQLite, replace MySQL function (like date_format, concat etc). But the main problem is, I have some data in Oracle DB. On production server everything is good. But when I tried to test the class, PHPUnit can not connect to oracle. I get error like this:

Fatal error: Call to undefined function yajra\Pdo\oci_connect() in C:\wamp\www\usfoot\vendor\yajra\laravel-pdo-via-oci8\src\yajra\PDo\Oci8.php on line 21

26 May
4 years ago

Mego left a reply on Migrate Whole Database With Laravel-5-Generator

No. I am afraid it's in specification, that we should make tests with SQLite.

Mego left a reply on Migrate Whole Database With Laravel-5-Generator

It's dummy data. Too stupid dummy data :D For example, in table players I have got more than 45000 players. In table of matches there are only three matches. I can't do any changes in database, because the same database is shared by Java developers, testers, etc. (I don't understand, why the test must write me, not tester...)

I wrote, that size of file is irrelevant. So the only problem I have now, it's about exporting new database. I am using MySQL database, GUI is MySQL Workbench. I can download all tables, schemas, values, keys, properties... in one file, called database.sql. That's what I want, and that's what I know to do.

But the problem is, that I don't know, how can I import that file after that. How can I import that file into SQLite? SQLite hasn't GUI... So how can I upload this file into SQLite and make the data in SQLite the same as data in MySQL? That's my only problem.

Mego left a reply on Migrate Whole Database With Laravel-5-Generator

I need to get migration files. Or is there another way?

I know, I can download full SQL dump (it would be maybe 450MB). But how can I import that file to SQLite after that?

Mego left a reply on Sublime Text - What Color Scheme You're Using?

Pastels on Dark. Very good, your eyes don't hurt

Mego started a new conversation Migrate Whole Database With Laravel-5-Generator

I want to use this: https://github.com/laracasts/Laravel-5-Generators-Extended

I have a large MySQL database with more than 100 tables and thousends of rows. I need to make a migration of it and make a database/migrations file, where will be everything (si┼że of file is irrelevant). Then I need to migrate whole database with all tables,values,keys,... into SQLite to start testing there. Can somebody help me, how can I make migration all-in-one file? Thank you for help

25 May
4 years ago

Mego left a reply on Unsupported Driver [oracle]

Yeah... one of developer delete table AREA from database... s*itty job :D That's the problem...

Mego left a reply on Unsupported Driver [oracle]

Now I am using yajra. But my MySQL database seems to be away. I don't know, what happend