reaz

reaz

Member Since 4 Months Ago

Experience Points
2,610
Total
Experience

2,390 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
22
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,610 XP
Feb
02
3 weeks ago
Activity icon

Replied to Dont Show Login Page Page, If User Is Logged In

Thanks , this seems like the simpler solution. @bibekgiri

Activity icon

Replied to Dont Show Login Page Page, If User Is Logged In

This also seems odd to me, but in fact this is happening. I am using default auth scaffolding of version 5.8 . Only change i have made is to copy the form from login page , and moved it to welcome page. Then changed the unauthenticated function like this:

protected function unauthenticated($request, AuthenticationException $exception)
    {
        return $request->expectsJson()
                    ? response()->json(['message' => $exception->getMessage()], 401)
                    : redirect()->guest(route('welcome'));
    }

For now to solve the problem stated in this question, i have added this bit in the web.php file:

Route::get('/', function () {
    if (Auth::check()) {
        return redirect()->route('home');
    }
    return view('welcome');
})->name('welcome');

Do you think this is right approach? @snapey

Feb
01
3 weeks ago
Activity icon

Replied to Dont Show Login Page Page, If User Is Logged In

@snapey , My problem is not really the back button. Since multiple user will be logging in form the the same device, So imagine user1 logged in, but did not log out. Then loaded some other website. Now second user comes in enters the 'mydomain.com' in the address. This will show the homepage(login page), user2 enter his login details, but after clicking login ends up in first user's homepage, which would be confusing to the user2. It would be great if second user enter the address , then without showing the login page(form), it ends up in first user's homepage. So he know someone else is logged in, so he will log out the first user.

This behavior already happens with the /login page in the laravel(5.8) default auth. I just want the same thing on the homepage because this is my login page. Thanks

Activity icon

Replied to How Do I Add Foreign Key In For The Users Table?

@sanjivst , you need to create a relationship method in the User model with the exact name of the relationship. There you can specify the foreign_key and local key and the name of intermediate Table Docs: https://laravel.com/docs/6.x/eloquent-relationships#has-many-through

Activity icon

Started a new Conversation Dont Show Login Page Page, If User Is Logged In

My problem is somewhat similar to this problem: https://laracasts.com/discuss/channels/laravel/how-to-prevent-showing-login-page-after-user-logged-and-hit-browser-back-button

In my case , it is a closed system, so main page is the login page. Now i want to prevent a logged in user to visit this page. In laravel default auth system, once you are logged in you cannot visit /login route. How do i replicate this behavior for main page. So if a logged in user visit main page (fx mydomain.com) they will redirected to their homepage. Thanks in advance

Jan
26
1 month ago
Activity icon

Replied to File Storage In Local And Public Storage At The Same Time.

@jeffreyvanrossum , thanks for your reply. This makes sense now. I was confused about which directory was getting symlinked. Now my user avatar's are at storage/app/public/avatar and the user files are at storage/app/user-files folder. Avatars are fine, i am able to link them in vue front-end via :src .

Now the problem i am facing is how can these file be downloaded by the user(a user should only be able to download his own file). I tried this :(https://laravel.com/docs/5.8/filesystem#downloading-files), but it only works if the user-file directory is under public directory. Any suggestion will be highly appreciated. Thanks.

Activity icon

Replied to File Storage In Local And Public Storage At The Same Time.

@snapey , regarding no. 1, lets say user images are saved in storage/avatar and the user files are in storage/user-files. LATER when i use php artisan storage:link . This will make both the folder publicly accessible. How would you solve this? one way i thought is instead of using default artisan command, i have to manually symlink the ```storage/avatar` folder to the public directory. I am interested to know your opinion. Thanks.

Jan
20
1 month ago
Activity icon

Started a new Conversation File Storage In Local And Public Storage At The Same Time.

In my project i have two kind of files first one is user avatar, and the next one is user uploaded files. (image,pdf). As you can imagine, first one should be publicly available, but the next one should only be available to specific user to be downloaded.

Now since files in public disk(symlinking storage/app to public/storage) is publicly available, is it possible to upload the user files to 'local disc' so they are not publicly available. Or i can use only one kind of storage throughout my project, be it public or local. Thanks in advance for your assistance.

Jan
17
1 month ago
Activity icon

Replied to Run DB Setup For CMS Only Once

You can put the code related to inserting data into options table into a seeder file. Then run the migration command with --seed option. That will insert the necessary data into DB. https://laravel.com/docs/6.x/seeding#writing-seeders

Activity icon

Replied to How To Increase Search Filed Width?

Just a suggestion: to show the row number, you dont really need an extra variable n, you can just use $loop->iteration inside the loop, it will print current iteration number like 1,2,3

Jan
16
1 month ago
Activity icon

Started a new Conversation How To Store Data About Trello Style Board.

Hi , This probably a mixed question with JavaScript. Forgive me if this is inappropriate for this forum. I am looking for some brainstorming ideas form fellow developers. In my project, i am creating trello style board with different column. Moving cards in different column fires up an ajax request which updates the 'status' in the db, So the changing of column is persistent. But i can not figure out a way to determine the position of the card in the column.(i.e if it at the top, botttom etc.) . What data do you save for this? Has Anyone implemented this kind of feature in their project. Please share your experience.

Jan
14
1 month ago
Activity icon

Replied to How To Select Column From Nested Relationship

Thanks. This has worked great. Actually it had more relations with multiple 'with' method chained in the actual code, but i only posted related portion for simplicity. But now with your suggestion, i can squash them all in one and this is more elegant and simple. Thanks for your time.

Update:

An cautionary advice for anyone else following this suggestion, we really have to make sure that there is no space between the column names while we writing this. I have put spaces in between to make it easily readable, but then it stopped working. took me half hour to realize this.

Activity icon

Started a new Conversation How To Select Column From Nested Relationship

Hi, I have a model relationship where a 'topic' has comments, 'comments' have user. Now in the json response i want to send topic with comments and related user. How do i go about selecting only specific columns from second level relationship. I can do it for first level, but i cannot figure out how do i do it for the next level. From the related user table i would like to send only firstname column.

$topic = Topic::where('topicId',$id)->with(['comments' =>                  function($query){$query->select('commentId','commentText','topicId','created_at','userId');}]) 
Nov
13
3 months ago
Activity icon

Replied to Password Setup For User By Admin

thanks. It is clear to me now. Also can you please share some ideas how should i go about the sending password reset email after user creation. should i add this process at the boot() of the model as 'created' event?

Activity icon

Replied to Password Setup For User By Admin

Hi Nakob, Thanks for the helpful reply. i was also thinking along that line. Only confusion i am having is do i save the user to users table when the admin submit this form? then send a password reset link to this newly created user?

Activity icon

Started a new Conversation Password Setup For User By Admin

Hi , I am working on system where only admin can register new users. So admin will fill in the register form with user's last name, first name other info, then the the user will receive an email to setup a password. How can i customize the default auth system to achieve this. I am using 5.8

Any advice will be highly appreciated.