mrkarma4ya

mrkarma4ya

Member Since 6 Months Ago

Experience Points
6,750
Total
Experience

3,250 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
59
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
6,750 XP
Jan
15
2 days ago
Activity icon

Commented on Practical Component Exercise #3: Tabs

Late, but I can provide you my code if you still want it. It's working for me.

Jan
11
6 days ago
Activity icon

Started a new Conversation Dear Jeffery , Please Make The Ottomatik Ad Below The Video Open In New Tab.

Sometimes, I click it by mistake.

Jan
10
1 week ago
Activity icon

Replied to Option To Save Video Quality Setting.

Same case, but opposite for me. My wifi is a bit slow, so the videos automatically start at 720p. But I can't watch it under 1080p, I just don't see the codes clearly unless its at 1080p, so I am willing to let it buffer a bit before watching.

Activity icon

Replied to AJAX For Laravel

I already know the basics of vanilla JS, so if Vue tutorials include Ajax, I can just skip dedicated AJAX tutorials?

Btw, do you have any other JS suggestions before Vue? I have some videos on ES6, Async (callbacks and promises), Fetch API) on my 'Learn JS' playlist. Which ones do you think I should learn before Vue and which ones can I skip because learning Vue will teach them anyway?

It's just that I'm planning to get the basics of Vue down this weekend, and I don't want to repeat lessons.

Activity icon

Started a new Conversation AJAX For Laravel

I'm planning to learn Vue JS, but I thought it'd be better if I learnt some basics first, like AJAX, jQuery, etc.

What's the best way to learn AJAX for Laravel? The tutorial I'm watching right now is using Vanilla ES5 JS for Ajax, but he mentions that it can be used with jQuery, Axios, etc.

I believe Laravel already has Axios out of the box? If so, Should I learn Axios, then AJAX with Axios or stick with Ajax with Vanilla JS?

Or should I skip AJAX altogether if I'm going to learn Vue later anyway?

Activity icon

Replied to Can Post Requests Set In Route Be Sent From A Different Website?

Sounds good. Thanks for the input!

Activity icon

Replied to Can Post Requests Set In Route Be Sent From A Different Website?

What if I don't need to use auth?

For ex. lets say a "Contact Us" form in a website. User doesn't need to register or login to send us a basic query, just put their contact info and message and send it.

I've noticed other tutorials do something like this instead (as opposed to Laracasts) :

<form method="POST" action="[email protected]">
.
.
</form>

without having it in the routes file.

Is this the safer/preferred method?

Jan
09
1 week ago
Activity icon

Started a new Conversation Can Post Requests Set In Route Be Sent From A Different Website?

If I have a form that sends a POST request to mywebsite.com/formsubmit and my route file has

Route::post('formsubmit', [email protected]);

Can a different website (say yourwebsite.com) have something like

<form method='POST' action='mywebsite.com/formsubmit'>
...
...
</form>

store data into mywebsite.com's database?

Does csrf prevent these?

Activity icon

Replied to How To Redirect To An Anchor When Using Back() ?

This worked, kinda.

It does scroll down, but not fully to the error section. It just stops midway.

However, I have a link in the page that links to the error too (for testing), and that fully scrolls down to the error section.

Activity icon

Started a new Conversation How To Redirect To An Anchor When Using Back() ?

I have a page where if there is an error on form submission, it redirects to the same page using

return back()->with('message', 'Some Error');

However, the error message is at the bottom of the form, so I want it to auto scroll to the div with #message. How do I pass #message on back()?

Jan
06
1 week ago
Activity icon

Replied to Looking For A Good Tutorial On Implementing Recaptcha V3 On Laravel 6

Edit: I got the response token too, turns out you have to put the same thing in the 'action' in the script as the form.

Activity icon

Replied to Looking For A Good Tutorial On Implementing Recaptcha V3 On Laravel 6

I did check the first link before, and the backend part was really confusing.

The second one is even more confusing for me.

Anyway, I followed the first link and added this in my controller

$url =  'https://www.google.com/recaptcha/api/siteverify';
        $data = [
            'secret' => config('app.secret'),
            'response' => request('recaptcha')
        ];
ddd($data);

This is the output:

array:2 [▼
  "secret" => "6LeNr8*******"
  "response" => null
]

As you can see, the secret key is received correctly, but the response is null, which I'm guessing shouldn't be the case? Can you help me figure this out?

Activity icon

Started a new Conversation Looking For A Good Tutorial On Implementing Recaptcha V3 On Laravel 6

I've been looking for a good tutorial on the topic, but I haven't found any that is beginner'friendly.

I'm looking for one that teaches how to install and implement Google Recaptcha using this package: https://github.com/google/recaptcha

Most tutorials are just blocks of code saying - copy this into that, but I don't know what they do at all.

What I've done:

Generated the site and secret keys and put them in my env file.

This is in my header:

<script src="https://www.google.com/recaptcha/api.js?render={{ env('CAPTCHA_SITE_KEY') }}"></script>

This is in footer:

<script>
        grecaptcha.ready(function() {
    grecaptcha.execute('{{ env('CAPTCHA_SITE_KEY') }}', {action: 'contact-us'}).then(function(token) {
       if(token){
           document.getElementById('recaptcha').value = token;
       }
    });
});
    </script>

And this is the field in contact form:

<input type="hidden" name="recaptcha" id="recaptcha">

After this, I'm completely lost.

Jan
05
1 week ago
Activity icon

Replied to Class 'App\Http\Controllers\Contact' Not Found

Could you explain it a bit?

I renamed the Mail/Contact.php to Mail/Contact_email.php and made the necesssary changes inside that, and it's working now. Should I still use

use App\Mail\Contact as Contact_email;

?

What does it actually do? I'm a beginner so I don't really understand.

Activity icon

Replied to Class 'App\Http\Controllers\Contact' Not Found

@tisuchi This worked with a small tweak, since I had two contact.php, I changed the one under mail directory to Contact_email.php, and added

use App\Mail\Contact_email;

If I don't include the line above, I get this:

Class 'App\Http\Controllers\Contact_email' not found

I still don't understand why I have to use that model manually, but in the videos it works just by using the Mail facade. Shouldn't the mail facade automatically look in the mail directory?

Here's the video: https://laracasts.com/series/laravel-6-from-scratch/episodes/44

Activity icon

Started a new Conversation Class 'App\Http\Controllers\Contact' Not Found

I'm trying to send email following the latest Laravel 6 videos, but I'm getting this:

Class 'App\Http\Controllers\Contact' not found

Here's my ContactController.php:

<?php

namespace App\Http\Controllers;

use App\Contact;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;

class ContactController extends Controller
{
      /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //

       
        request()->validate([
            'fullname' => 'required:max:50',
            'email' => 'required|email',
            'subject'=>'required|max:100',
            'message'=>'required|max:500'
        ]);
        
        Mail::to(request('email'))
            ->send(new Contact());
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Contact  $contact
     * @return \Illuminate\Http\Response
     */
    public function show(Contact $contact)
    {
        //
        return view('pages.contact');
    }

    
}

I already have a 'Contact.php' in Mail folder, generated through

php artisan make:mail Contact

that looks like this:

<?php

namespace App\Mail;

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

class Contact 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->view('email.contact');
    }
}

The only different thing I did from the tutorial was make a Contact model too like this:

php artisan make:model -mcr

Because I want to store it in the database too.

How do I solve this error? It looks like its looking for a Contact.php in the 'App\Http\Controllers\ directory instead of the 'App\Mail' directory

Jan
02
2 weeks ago
Activity icon

Replied to Any Way To Download A Complete Laracasts Series?

@nakov @gazd1977 oh man 12$ a month, I can't afford it. Damn. Guess I'll just scour YouTube instead :(

Are paid videos downloadable too? Maybe I can buy a month of subscription and download everything.

Activity icon

Replied to Any Way To Download A Complete Laracasts Series?

OK,

Final Question (questions) I promise.

Is the 15$ Subscription one time, monthly, yearly? And can I pay with PayPal?

I don't have a credit card but I could manage Paypal.

Sorry for these small queries, and thanks a lot for your time and responses.

Activity icon

Replied to Any Way To Download A Complete Laracasts Series?

Oh ok,

Last question. There seems to be a bug in the notification times, I started this topic 20mins ago and notifications say 11 hrs ago.

Any way to report this?

https://imgur.com/JJwKxeh

Activity icon

Replied to Any Way To Download A Complete Laracasts Series?

Alright.

Also, is there a way to know if a course is premium only before starting it? I don't see any indication at all a this page:

https://laracasts.com/series

Activity icon

Started a new Conversation Any Way To Download A Complete Laracasts Series?

My connection at home is not so great, and it's difficult to read what Jeff is writing at anything lower than 1080p.

Is there a way to download all videos in a series?

Dec
31
2 weeks ago
Activity icon

Replied to Routes Not Working In Hosted App

Huh, for some reason, when uploading the files on the server, the .htaccess file was not uploaded at all (along with other hidden files like .env). I re-uploaded them, and it's working now, thanks for the help!

Dec
30
2 weeks ago
Activity icon

Started a new Conversation Routes Not Working In Hosted App

Hello,

My routes work fine on my local machine, but once I upload them in the hosting server, they don't work at all. Only the homepage works.

How can I fix this?

Here's my web.php file:

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/', '[email protected]')->name('home');
Route::get('/about', '[email protected]')->name('about');
Route::get('/services', '[email protected]')->name('services');


Route::resource('/posts', 'PostsController');
Route::resource('/comments', 'CommentsController');
Route::resource('/category', 'CategoryController');


Auth::routes();

Route::get('/dashboard', '[email protected]');

Route::get('posts/{id}/duplicate', '[email protected]');
Route::get('/logout', '\App\Http\Controllers\Auth\[email protected]');

Route::get('/dashboard/category/create', '[email protected]');
Route::get('/dashboard/category', '[email protected]_category');
Route::get('/dashboard/posts', '[email protected]_posts');

And here's a link to my hosted app: lekham.ushostserver.com

Activity icon

Replied to Why Does {{ Auth::user() }} Work Anywhere But Other Models Don't?

@nakov

So I have to pass the Category model in all my controllers, then pass the $categories variable in each and every controller function?

I know that works, I tried it before. But its so much repetition.

Is there a way to define something like '$sidebar_categories' that pulls name of all categories from the Category model and can be used globally? I just need to load it into my 'sidebar.blade.php' file, which is loaded in all other views.

Maybe I can define it in the Controller.php itself, since all controllers extends it. But I'm not sure how to make that work.

Activity icon

Started a new Conversation Why Does {{ Auth::user() }} Work Anywhere But Other Models Don't?

How come {{ Auth::user() }} works anywhere but any other model I need to import with the 'use' command?

I want to display a list of categories in all my pages, but I keep getting 'Class 'Category' not found'. I'm trying this right now:


@foreach (Category::orderBy('name', 'asc') as $category )
        <li><a href="#">{{ $category->name }}</a></li>
@endforeach

Can I make Categories model universally accessible like Auth? Or this there a better way to do this?

Dec
06
1 month ago
Activity icon

Replied to App URL Not Working Properly?

Thanks a lot!

As i said, if i use slash, i get localhost/storage/... Instead of localhost/lsapp/public/storage/... Even though my app url is localhost/lsapp/public. How can I solve this issue?

I'm fairly new, so I have no idea how to use those helpers you mentioned.

Btw, can (or should) I define my directories in env file and use it instead?

Activity icon

Started a new Conversation App URL Not Working Properly?

Hello,

I started learning Laravel from Traversy Media's tutorial, so like he taught, I used virtual hosts in XAMPP to point my app public folder "localhost/lsapp/public" to lsapp.com. After the course, I removed the virtual host codes because I needed to work on some other work related projects too.

Now, I'm trying to access the website directly from localhost/lsapp/public, and the website loads, but all the links that I put manually in the views and routes are using just localhost. I have also changed the APP URL in the .env file, and using the URL function returns "localhost/lsapp/public/", the login and register URLS are pointed correctly too, but everything else is broken. I have also cleared the config cache.

Here's what happens:

If I put something like <img src="/storage/images/image1.jpg">, it points to "localhost/storage/images/image1.jpg" instead of "localhost/lsapp/public/storage/images/image1.jpg".

EDIT:

Just as I was writing this post, I tried using <img src="storage/images/image1.jpg"> instead of <img src="/storage/images/image1.jpg"> (removed the first slash in src) and now its working.

It was working properly even with the slash before, when it was working through lsapp.com, could someone tell me the difference between putting the slash and not putting it?

Also, I'm gonna post this and keep it up, in case someone else has the same issue in the future.

Oct
13
3 months ago
Activity icon

Replied to Cannot Get ANSI Colors To Work In VS Code Git Bash Integrated Terminal

@untymage As I mentioned, I don't want to enter --no-ansi everytime (a permanent solution for this would be nice) and the other answer seems only for external git bash, not for VS Code integrated git bash. I even tried changing the path of git bash from bin/bash.exe to git-bash.exe, it opens it externally that way.

Oct
12
3 months ago
Activity icon

Started a new Conversation Cannot Get ANSI Colors To Work In VS Code Git Bash Integrated Terminal

I spent around 2-3 hours yesterday searching for a solution, but I haven't found any.

I know this isn't strictly Laravel related, but Laravel is the first thing I'm learning other than basics, so I don't know where else to ask. I'm only using git bash for Laravel as of now.

I'm using Git Bash as the integrated terminal in VS Code. However, ANSI colors are not working and instead I'm getting the codes to replace them.

Here's a screenshot: https://imgur.com/3yqbRfM I followed both the answers in this post: https://stackoverflow.com/questions/42102657/bash-terminal-colors-in-integrated-terminal-in-vs-code

The first answer got rid of the color codes but did not display colors, only in the external terminal. No change in integrated terminal, even after putting the aliases.

The second answer also kinda worked, it got me the colors. Everything is repeated twice, so it's difficult. Here's an example: https://imgur.com/cBcrrb7 Please help me get the colors working, or maybe just get rid of ansi overall in php artisan commands, without having to put --no-ansi in every command.