nipun

nipun

Member Since 10 Months Ago

Sri Lanka

Experience Points
870
Total
Experience

4,130 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
2
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
870 XP
Dec
20
1 month ago
Activity icon

Started a new Conversation Disable Middleware Only For A Specific Function In Controller If User Pass Data From A Specific Route

Requirement

If data were passed into the function via a specific route then middleware authentication to be escaped only for a specific functions.

What I have tried

So I know I can use below method to escape middleware authentication for a specific function I want But when I do this it will ignore authentication for spec_add function from all routes.

public function __construct ()
    {
        $this -> middleware ( 'auth'  ,['except' => ['spec_add']]) ;
    }

I know I can implement something like below. But what I wants to know that is there is a better way to do this rather than below method.

public function __construct ()
{
    if (  url () -> previous () == 'special_url'){
        $this -> middleware ( MiddlewareConstants::Auth . ':' . GuardConstants::Customers  ,['except' => ['addAddress']]) ;
    }else{
        $this -> middleware ( MiddlewareConstants::Auth . ':' . GuardConstants::Customers  ) ;

    }
}

Thanks

Dec
18
1 month ago
Activity icon

Replied to Laravel Sitemap Generator Output Empty File

Tested all the things. No errors in log too

Dec
17
1 month ago
Activity icon

Replied to Laravel Sitemap Generator Output Empty File

@snapey thanks for commenting. My working sitemap was generated via a online service. Also i change it to https. When I changed it this is the out put

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
</urlset>
Activity icon

Replied to Laravel Sitemap Generator Output Empty File

Thank you for this. But still no luck

Activity icon

Replied to Laravel Sitemap Generator Output Empty File

no actually what I needs to do is to check a site which has lot of links. So im testing with this url.My real requirement to automate this with a another site which has lot of url s

Activity icon

Replied to Laravel Sitemap Generator Output Empty File

Ahaa yeah true . I just saw a post in laracast about this package and saw you all . Thats why I mentioned you guys . Take your time 😁😍😍😍😍

Activity icon

Started a new Conversation Laravel Sitemap Generator Output Empty File

I have installed a fresh Laravel (v 6.7) project and then installed this package spatie/laravel-sitemap ( https://github.com/spatie/laravel-sitemap) . So then as in the documentation I have added below code into my route file web.php file


use Spatie\Sitemap\SitemapGenerator;

Route::get('/sitemap', function () {
ini_set('max_execution_time', 300); // 5 minutes
SitemapGenerator::create('http://sandrianaplantations.com/')->writeToFile('sitemap.xml');
return 'completed';
});

Then when I check sitemap.xml file it has below content


 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://sandrianaplantations.com/</loc>
<lastmod>2019-12-17T06:35:43+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</urlset>

But if I generate the site map for above url via XML-sitemap.com (https://www.xml-sitemaps.com/details-sandrianaplantations.com-922a2db5e.html) it generate below content

 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!--
 created with Free Online Sitemap Generator www.xml-sitemaps.com 
-->
<url>
<loc>https://sandrianaplantations.com/</loc>
<lastmod>2019-12-17T06:33:44+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://sandrianaplantations.com/About-us/</loc>
<lastmod>2019-12-17T06:33:44+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://sandrianaplantations.com/Gallery/</loc>
<lastmod>2019-12-17T06:33:44+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://sandrianaplantations.com/Contacts/</loc>
<lastmod>2019-12-17T06:33:44+00:00</lastmod>
<priority>0.80</priority>
</url>
</urlset>

So could anyone please tell me if Im making any mistakes in my route file.(web.php) .I have gone through there official document. But nothing can be found. Also gone through YouTube too.