This New Function In Laravel Is Really Great

Recently Tim MacDonald has contributed to creating a fake() function that can be used globally. Using this function, we can easily prototype, test, and generate data.

Here I will directly model it for users. Remember, there is no such thing as a table setup, let alone a factory.

@for ($i = 0; $i < 10; $i++)
    <li>Name: {{ fake()->name() }}</li>
    <li>Email: {{ fake()->email() }}</li>
    <li>Phone: {{ fake()->phoneNumber() }}</li>

Or for example "single record":

    <h1>{{ str(fake()->sentence())->title() }}</h1>
        @foreach (fake()->paragraphs(12) as $item)
        <p>{{ $item }}</p>

Hopefully, this information will be useful.

Find some typo, just make the pull request on Github.
© 2022 Irsyad Notes. All rights reserved.