JeroenvanRensen

JeroenvanRensen

Member Since 2 Months Ago

Utrecht, the Netherlands

Experience Points
44,750
Total
Experience

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
392
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 9
44,750 XP
Aug
09
13 hours ago
Activity icon

Started a new Conversation JS - Reg Ex New Value In Str Replace

Hi everyone,

I have got a problem with Regular Expressions. I do have this string:

https://nl.wikipedia.org/wiki/Republikeinwever

And I want to change it to this:

https://nl.m.wikipedia.org/wiki/Republikeinwever

But, nl and Republikeinwever can change, and it should still work.

So this:

https://en.wikipedia.org/wiki/World_War_II

Should become this:

https://en.m.wikipedia.org/wiki/World_War_II

How can I do this in pure JS?

I tried to do it with Regular Expressions, but couldn't solve it.

Something like this?

var newValue = oldValue.replace(
    /https:\/\/([a-z]+).wikipedia.org\/wiki\/([A-Za-z]+)/i,
    https://.m.wikipedia.org/wiki/
);

I hope anyone can help me.

Thanks!

Aug
02
1 week ago
Activity icon

Started a new Conversation Tinker: "Call To A Member Function Tags() On Null" But PHPunit Does Work

Hi everyone,

I am testing my code in Tinker, after it worked in PHPunit. In tinker I got the following error:

PHP Error:  Call to a member function tags() on null in C:/wamp64/www/laravel/sahara/app/Bookmark.php on line 53

Ater trying this command:

$bookmark = App\Bookmark::first();
$bookmark->addTag('bootstrap');

And this is my addTag() method in my Bookmark model:

/**
 * Add a tag to the bookmark based on a string
 * 
 * 1. If the tag already exists on the bookmark, return
 * 2. If the tag doesn't exist, create it
 * 3. Attach the tag to the bookmark
 * 
 * @param   string  $tag
 * 
 * @return  null
 */
public function addTag($tag)
{
    if($this->tags()->where('name', $tag)->exists()) {
        return; 
    }

    if(auth()->user()->tags()->where('name', $tag)->exists()) {
        $tag = auth()->user()->tags()->where('name', $tag)->first();
    } else {
        $tag = Tag::create([
            'name' => $tag,
            'slug' => $tag,
            'user_id' => auth()->id()         
        ]);
    }

    $this->tags()->attach($tag);
}

Howevery, the tags relation does exist in my Bookmark model:

/**
 * Returns all the tags which a bookmark does have
 * 
 * @return  App\Tag[]
 */
public function tags()
{
    return $this->belongsToMany(Tag::class, 'bookmark_tags');
}

Note: I did not forget to run my migrations.

So, whats going on here?

I hope anyone can help me.

Thank you! Jeroen

Jul
20
2 weeks ago
Activity icon

Replied to Laravel File Storage - Deleting Files Doesn't Work (also No Error Provided)

Hi @mabdullahsari and @chr15k,

Your methods didn't work for me, so I've made it so it only delete the relationship.

Once per month I can delete all files using a cron job.

However, thanks for your answers!

Jul
19
3 weeks ago
Activity icon

Started a new Conversation Anchor Tag Not Showing

Hi everyone,

I've got a crazy problem here:

I've got an anchor tag in my database which I'm showing with VueJS. Directly before it I manually create an anchor link:

<div><a href="#">Link</a> {{ body }}</div>

However, I got this on my page:

My BS Card

And this is what I see in Firefox Devtools:

Firefox Devtools

Can anyone see and tell me what I'm doing wrong? Maybe Vue doesn't allow you to get anchor links out of the database, but then I guess I should see anything else in my Devtools.

Activity icon

Started a new Conversation Laravel ShouldReceive Method Not Found, And What Is It?

Hi everyone,

I'm following a Laracasts tutorial (Build a stock tracker app) and I've got the following problem:

I don't know what the shouldReceive method is and what it should do, but I got this error:

Error: Call to undefined method App\Clients\ClientFactory::shouldReceive()

I have imported the ClientFactory, and here are some things that maybe went wrong:

  • The ClientFactory does not have a shouldReceive method
  • The ClientFactory does not extend or implement another class

Here's some code:

StockTest

/** @test */
public function it_updates_local_stock_status_after_being_tracked()
{
    $this->withoutExceptionHandling();
    
    $this->seed(\RetailerWithProductSeeder::class);

    ClientFactory::shouldReceive('make')->andReturn(new FakeClient);

    $stock = Stock::first()->track();

    $this->assertTrue($stock->in_stock);
    $this->assertEquals(9900, $stock->price);
}

ClientFactory

<?php

namespace App\Clients;

use App\Retailer;

class ClientFactory
{
    public function make(Retailer $retailer): Client
    {
        $classname = \Str::studly($retailer->name);
        $class = 'App\Clients\'.$classname;
    
        if(!class_exists($class)) {
            throw new ClientException('Client not found for '.$retailer->name);
        }
    
        return new $class;
    }
}

I really don't know what the shouldReceive method does and how to fix this problem.

I hope anyone else can help me.

Thank you! Jeroen

Jul
18
3 weeks ago
Activity icon

Replied to Laravel Database Seeding Class Not Found

Hi @bezhansalleh,

I tried your code and it's finally working, so thanks!

I don't see a spelling mistake, I only see the imports I seems to be forgotten.

Do you know why I didn't get a more specific error?

Thank you! Jeroen

Activity icon

Replied to Laravel Database Seeding Class Not Found

Hi @gamerfac3, @bezhansalleh,

I changed the name and ran this command:

php artisan db:seed --class=RetialerWithProductSeeder

Now I got this error:

   Illuminate\Contracts\Container\BindingResolutionException

  Target class [RetialerWithProductSeeder] does not exist.

  at C:\wamp64\www\laravel\stock-tracker\vendor\laravel\framework\src\Illuminate\Container\Container.php:807
    803|
    804|         try {
    805|             $reflector = new ReflectionClass($concrete);
    806|         } catch (ReflectionException $e) {
  > 807|             throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
    808|         }
    809|
    810|         // If the type is not instantiable, the developer is attempting to resolve
    811|         // an abstract type such as an Interface or Abstract Class and there is

  1   C:\wamp64\www\laravel\stock-tracker\vendor\laravel\framework\src\Illuminate\Container\Container.php:805
      ReflectionException::("Class RetialerWithProductSeeder does not exist")

  2   C:\wamp64\www\laravel\stock-tracker\vendor\laravel\framework\src\Illuminate\Container\Container.php:805
      ReflectionClass::__construct("RetialerWithProductSeeder")

I really don't know what to do here.

Activity icon

Replied to Laravel Database Seeding Class Not Found

I tried it and it changed the error:

ErrorException: include(C:\wamp64\www\laravel\stock-tracker\vendor\composer/../../database/seeds/RetailerWithProduct.php): failed to open stream: No such file or directory
Activity icon

Started a new Conversation Laravel Database Seeding Class Not Found

Hi everyone,

I've got a database seeder class, which I want to use in my PHPunit test. However, I got this message: Target class [database\seeds\RetailerWithProduct] does not exist.

This is my Database Seeder

<?php

use Illuminate\Database\Seeder;

class RetailerWithProduct extends Seeder
{
    public function run()
    {
        $product = Product::create([
            'name' => 'Nintendo Switch'
        ]);

        $retailer = Retailer::create([
            'name' => 'Best Buy'
        ]);

        $stock = new Stock([
            'price' => 10000,
            'url' => 'https://www.example.org/',
            'sku' => 12345,
            'in_stock' => false
        ]);

        $retailer->addStock($product, $stock);
    }
}

And here's my PHPunit test:

/** @test */
public function it_tracks_product_stock()
{
    $this->withoutExceptionHandling();

    $this->seed(RetailerWithProduct::class);

    dd(Product::all());

    $this->assertFalse($stock->fresh()->in_stock);

    Http::fake(function() {
        return [
            'available' => true,
            'price' => 29900
        ];
    });

    $this->artisan('stock:track');

    $this->assertTrue($stock->fresh()->in_stock);
}

Two things are getting my attention:

  • I do not import the Database Seeder in my test
  • The Database Seeder doens't have a namespace

But I'm watching a Laracasts series and Jeffrey also doesn't one of these.

I think I have everything the same, but why do I get this error?

Thank you! Jeroen

If you need more information, please ask me.

PS: I also ran composer dump-autoload

Activity icon

Started a new Conversation Laravel Custom Validation Uses Validate Function Instead Of Passes

Hi everyone,

I've got a problem: I'm creating custom validation methods, but I have to use a validate() and a passes() method, but I should only have to use the passes() function.

If I remove one of them, it fails. I got an error or it passes without the proper validation.

What could be the problem?

Thank you! Jeroen

Jul
16
3 weeks ago
Activity icon

Replied to Laravel File Storage - Deleting Files Doesn't Work (also No Error Provided)

Hi @mabdullahsari,

No I haven't, but it's still not fixed.

I ran this command:

C:\wamp64\www\laravel\wauwcloset>php artisan storage:link

And got this output (in green):

The [C:\wamp64\www\laravel\wauwcloset\public\storage] link has been connected to [C:\wamp64\www\laravel\wauwcloset\storage\app/public].
The links have been created.

But I think nothing has changed.

I really hope you can help me.

Thank you! Jeroen

Activity icon

Replied to Laravel Notifications - Exists In Database, But Not In Auth()->user()->notifications

@manelgavalda Thank you so mush! I completely forgot about that! Thanks!

Activity icon

Started a new Conversation Laravel Notifications - Exists In Database, But Not In Auth()->user()->notifications

Hi everyone,

I've got a strange problem, and I'm trying to fix it for an hour now, but I give up. I hope anyone else can help me.

This is my TDD test:

/** @test */
public function a_subscribed_user_gets_a_notification_by_a_new_reply()
{
    $this->withoutExceptionHandling();
    
    $user1 = factory('App\User')->create(); // User who leaves the reply
    $user2 = factory('App\User')->create(); // User who subscribes and gets notified

    $thread = factory('App\Thread')->create();

    // User 2: User who subscribes and gets notified
    $this->actingAs($user2);

    $thread->subscribe();

    $this->assertCount(0, auth()->user()->notifications);

    // User 1: User who leaves the reply
    $this->actingAs($user1);

    $reply = factory('App\Reply')->make([
        'thread_id' => $thread->id
    ]);

    $this->post($thread->path().'/replies', $reply->toArray())
        ->assertStatus(302);

    // User 2: User who subscribes and gets notified
    $this->actingAs($user2);

    $this->assertDatabaseHas('notifications', [
        'type' => 'App\Notifications\ThreadWasUpdated',
        'notifiable_id' => $user2->id,
        'notifiable_type' => 'App\User'
    ]);

    $this->assertCount(1, auth()->user()->notifications); // not working
}

I know, little bit complex, but it should work. And it does, except for the last assertion. So the row does exist in the database (as you can see) but I can't get the user notifications.

Does anyone know what I'm doing wrong?

Also, in the browser it also works completely fine.

I really hope someone can help me out.

Thank you! Jeroen

Jul
15
3 weeks ago
Activity icon

Replied to Do You Move Controller Methods To Models Or Not?

Hi @tisuchi @deepu07 @jeffreyvanrossum @mabdullahsari @jlrdw @snapey @bugsysha @martinbean,

Thanks for all of your answers! Like I read, it's better to move it to models. So I'm trying to do that. There are still some situations it feels "strange" for me, like the given example.

But for example I do like this method: $thread->subscribe($user).

Like I said, I'm gonna try to do it more often.

Again, thanks for all of your answers!

Jeroen

Activity icon

Awarded Best Reply on Laravel TDD - Attribute [store] Does Not Exist

It turned out: I made a mistake:

Route::store('/threads/{category}/{thread}/subscriptions', '[email protected]');

So, that's quite stupid...

Activity icon

Replied to Laravel TDD - Attribute [store] Does Not Exist

It turned out: I made a mistake:

Route::store('/threads/{category}/{thread}/subscriptions', '[email protected]');

So, that's quite stupid...

Activity icon

Replied to Laravel TDD - Attribute [store] Does Not Exist

Hi @jeffreyvanrossum,

I did some research and it turned out I always got that error, even in this test:

* @test */
public function one_equals_one()
{
    $this->withoutExceptionHandling();
    
    $this->assertEquals(1, 1);
}
Activity icon

Started a new Conversation Laravel TDD - Attribute [store] Does Not Exist

Hi everyone,

I'm creating a website with Laravel using TDD. I've got the following error:

Attribute [store] does not exist

Using this test:

* @test */
public function one_equals_one()
{
    $this->withoutExceptionHandling();
    
    $this->assertEquals(1, 1);
}

So what's going on here?

What can I do?

I searched on Google but couldn't find anything.

Thank you! Jeroen

Jul
14
3 weeks ago
Activity icon

Started a new Conversation Do You Move Controller Methods To Models Or Not?

Hi everyone,

I'm watching a lot of Laracasts series, and something I noticed was that Jeffrey moves a lot of his controller actions to models.

For example ReplyController:

public function store(Thread $thread) 
{
    request()->validate([
        'body' => ['required']
    ]);

    return $thread->addReply([
        'body' => request('body'),
        'user_id' => auth()->id()
    ]);
}

And Thread.php:

public function addReply($reply)
{
    $reply = $this->replies()->create($reply);

    event(new ThreadReceivedNewReply($reply));

    return $reply;
}

However, I personally prefer to do it this way:

ReplyController.php

public function store(Thread $thread)
    request()->validate([
        'body' => ['required']
    ]);

    $reply = $thread->replies()->create([
        'user_id' => auth()->id(),
        'thread_id' => $thread->id,
        'body' => request('body')
    ]);
}

What do you think, and what are your preferences?

I like to hear your thoughts.

Thank you! Jeroen

Jul
13
3 weeks ago
Activity icon

Awarded Best Reply on VueJS - Error Compiling Template: The Value For A V-bind Expression Cannot Be Empty. Found In "v-bind:data"

I found the problem: I was paginating the replies on the PHP end...

Activity icon

Replied to VueJS - Error Compiling Template: The Value For A V-bind Expression Cannot Be Empty. Found In "v-bind:data"

I found the problem: I was paginating the replies on the PHP end...

Activity icon

Started a new Conversation VueJS - Error Compiling Template: The Value For A V-bind Expression Cannot Be Empty. Found In "v-bind:data"

Hi everyone,

I've got a strange error:

[Vue warn]: Error compiling template:

The value for a v-bind expression cannot be empty. Found in "v-bind:data"

1  |  <div id="app">
   |  ^^^^^^^^^^^^^^
2  |          <nav class="navbar navbar-expand-lg navbar-light mb-5">
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3  |              <div class="container">
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4  |                  <a class="navbar-brand" href="/">Laravel Forum</a>
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5  |          
   |  ^^^^^^^^
6  |                  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent">
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7  |                      <span class="navbar-toggler-icon"></span>
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8  |                  </button>
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^

But in my navbar I don't use Vue, so what's going on here?

I also don't see a line number of the error, and npm run watch ran successful.

What can I do?

Thank you! Jeroen

If you need more information, please ask me.

Activity icon

Awarded Best Reply on Vue Method Not Found, But It Does Exist

Update

I found the problem, I just forgot to run npm run watch...

Activity icon

Replied to Vue Method Not Found, But It Does Exist

Update

I found the problem, I just forgot to run npm run watch...

Activity icon

Started a new Conversation Vue Method Not Found, But It Does Exist

Hi everyone,

I've got a strange situation: I get this error in my console:

[Vue warn]: Property or method "destroy" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

But I do have the method registred here, in ReplyComponent:

<script>
    export default {
        props: [
            'attributes',
            'path'
        ],

        data() {
            return {
                editing: false,
                body: this.attributes.body
            }
        },

        methods: {
            update() {
                axios.patch(this.path, {
                    body: this.body
                });

                this.editing = false;

                toast('Your reply has been updated!');
            },

            destroy() {
                console.log('delete');
            }
        }
    }
</script>

And here I'm calling it:

@can('update', $reply)
    <button class="btn btn-light" @click="editing = true"><i class="text-primary fas fa-pencil-alt"></i></button>
@endcan

@can('delete', $reply)
    <button class="btn btn-light" @click="destroy"><i class="text-danger fas fa-trash-alt"></i></button>
@endcan

As you can see, I also have a editing method which works completely fine.

So what's the problem here?

Thank you! Jeroen

Jul
11
4 weeks ago
Activity icon

Awarded Best Reply on Laravel HTTP - CURL Error 60: SSL Certificate Problem: Unable To Get Local Issuer Certificate

Hi @mvd,

I searched the whole internet, and I finally found it:

You have to change two php.ini files

Jeroen

Activity icon

Started a new Conversation Laravel HTTP - CURL Error 60: SSL Certificate Problem: Unable To Get Local Issuer Certificate

Hi,

I'm creating a game website with Laravel using this API and I got this message:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) 

What can I do to fix this?

I already tried the answer on this question on StackOverflow, but it doens't work for me.

I also saw this:

Database name seems incorrect

You're using the default database name laravel. This database does not exist.

Edit the .env file and use the correct database name in the DB_DATABASE key.

But I guess it has nothing to do with my error.

Can anyone please help me?

Thank you! Jeroen

Activity icon

Commented on Fetch Game Information From The IGDB API

Hi, I got this message:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) 

What can I do to fix this?

I already tried the answer on this question on StackOverflow, but it doens't work for me.

I also saw this:

Database name seems incorrect

You're using the default database name laravel. This database does not exist.

Edit the .env file and use the correct database name in the DB_DATABASE key.

But I guess it has nothing to do with my error.

Can anyone please help me?

Thank you! Jeroen

Jul
10
4 weeks ago
Activity icon

Commented on Make The Index Page Responsive

I didn't know it was that easy to make your website responsive in TailwindCSS. Thank you for making these videos!

Activity icon

Commented on Style The Index Page With Tailwind CSS

Really nice design and very good video, but why are you applying px-4 to all containers?

Activity icon

Commented on What We're Building

Looks very cool!

Activity icon

Started a new Conversation Laravel File Storage - Deleting Files Doesn't Work (also No Error Provided)

Hi everyone,

I've got this URL structure:

public/img/products/troje.jpg

The problem is, I can't delete a file.

If I run this command in PHP Artisan Tinker:

>>> Storage::delete('/img/products/troje.jpg');
=> false

I got, like you can see false as a return, but the file isn't deleted.

So what should I do?

Thank you! Jeroen

Jul
09
1 month ago
Activity icon

Replied to How To Check If A URL Is An Article Or Just A Web Page?

Hello everyone,

Thank you for all your answers!

The Open Graph Protocol really helps me out, so thanks @denniseilander!

Jeroen

Activity icon

Started a new Conversation Check If A HasMany() Relationship Has At Least One Item

Hi everyone,

I've got a products table and an images table. A product has many images.

In my products/index.blade.php file I want to show the first image for each product, if there is one.

How can I check this?

I think something like this, but it doens't work:

@if($product->images->exists())
    {{ $product->images->first() }}
@endif

Thanks for helping me out!

Jeroen

Activity icon

Replied to How To Check If A URL Is An Article Or Just A Web Page?

Hi @deepu07,

I could do that, but I want it to work for every website on the internet. Do you know some algorithm I could follow/use?

Jeroen

Jul
08
1 month ago
Activity icon

Replied to How To Check If A URL Is An Article Or Just A Web Page?

Hi @deepu07,

What do you mean with "URL extensions"?

Jeroen

Activity icon

Replied to Laravel Auth Middleware On Routes Testing With PHPunit

But that of course doens't work.

Should I place the protectedRoutesProvider() function in the same test?

What are the values of $method and $route?

Thank you! Jeroen

Activity icon

Started a new Conversation Laravel Auth Middleware On Routes Testing With PHPunit

Hi everyone,

I have got the following problem: I want to test auth middleware applied to routes/web.php in PHPunit.

I've got this code in my routes/web.php file:

Route::middleware('auth')->group(function () {
    Route::get('/admin', '[email protected]');
    
    Route::prefix('admin')->group(function () {
        Route::resource('products', 'ProductController');
    });
});

And this is my test:

/** @test */
public function guests_cannot_visit_the_admin_pages()
{
    $this->withoutExceptionHandling();
    
    $this->get('/admin')
        ->assertRedirect('/login');
}

It doens't work, but in my browser it does however work.

Can anyone explain this to me?

Thank you! Jeroen

Jul
07
1 month ago
Activity icon

Replied to What Are Best Practices When Writing Tests With PHPUnit ?

@relindwto6 I recommend to watch "Let's build a forum with TDD" on Laracasts

Activity icon

Replied to Laravel Crud Generator

@raycoder I don't understand your problem.

Activity icon

Replied to Laravel: One File With Two Classes?

Hi @ninjajoe,

I do know it's possible, but I do not recommend it because it's a lot cleaner if it's divided to two files. For more information, you can watch this serie on Laracasts about the PHP OOP fundamentals.

I hope I did help you.

Jeroen

Activity icon

Replied to Is A Old Laravel Website Still Safe?

Yes, for people after me it's a lot easier to update.

Activity icon

Started a new Conversation How To Check If A URL Is An Article Or Just A Web Page?

Hi everyone,

I've got a complex question: How to check if a URL is an article or just a web page?

For example, nos.nl is a web page, but nos.nl/artikel/2339900-kabinet-past-corona-spoedwet-aan-na-kritiek.html is a textual article.

I want to recreate something like Pocket, and if you safe a web page, it automatically knows if it's a text article or a page.

I can't say it's an article if there's an article tag on the page, Ican't just count the words, so what can I do?

Thank you! Jeroen

Activity icon

Replied to What's The Benefit Of Moving Controller Methods To A Model?

Hi @michaloravec,

That's a really clean and beautiful way of doing it! I like it!

I do prefer to use your first example.

Thank you! Jeroen