GianniGianni

GianniGianni

Member Since 4 Years Ago

Rome, Italy

Experience Points 7,080
Experience Level 2

2,920 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 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

11 Jun
2 years ago

GianniGianni left a reply on Teams & Team Billing

I'm interested in this too! ????

GianniGianni left a reply on Extending Spark Registration Validation

You can define new validation roules and inside the booted() method of the class App\Providers\SparkServiceProvider

Spark::validateUsersWith(function (Request $request) {
    return [
        'name' => 'required|max:255',
        'email' => 'required|email|unique:users,email,'.$request->input('name'),
    ];
});
27 Jan
3 years ago

GianniGianni left a reply on How Homestead Was Created

These are the scripts that build the Laravel Homestead development environment.

https://github.com/laravel/settler

15 Jul
3 years ago

GianniGianni left a reply on Which System Uses The Person In The Video?

I'm pretty sure the text editor is atom

20 Jun
3 years ago

GianniGianni left a reply on [L5.1] Test Fails But It's Ok Using The Browser

The /statuses page display only the statuses posted by the user logged-in

Seems that after posting the status phpunit does a logout or refresh the database. But why?

GianniGianni left a reply on [L5.1] Test Fails But It's Ok Using The Browser

The only difference between the HTM I see in the browser and the HTML printed out by phpunit is the presence of the string My first post.

GianniGianni started a new conversation [L5.1] Test Fails But It's Ok Using The Browser

I've written the following test

http://pastebin.com/sL0u8Ztn

If I user the browser everything works, but the test fails with:

Failed asserting that '[HTML code of the page]' matches PCRE pattern "/My first post/i".

Can you help me?

GianniGianni left a reply on [L5.1] Model Factories And Relationships

The best thing would be both things combined together.

I remember I use to do 'user_id' => 'faker:App\User', with TestDummy package

GianniGianni left a reply on [L5.1] Model Factories And Relationships

@RachidLaasri If I do like you said, factory will create a new User for every invocation, instead of picking un one randomly

GianniGianni started a new conversation [L5.1] Model Factories And Relationships

I am playing withe the new Model Factory feature, but I don't know how to use relationship in it.

In my project a User has may Status(es) and a Status belongs to a User

This is my ModelFactory.php file:

$factory->define(App\User::class, function ($faker) {
    return [
        'name' => $faker->name,
        'email' => $faker->email,
        'password' => str_random(10),
        'remember_token' => str_random(10),
    ];
});

$factory->define(App\Status::class, function ($faker) {
    return [
        'body' => $faker->sentence,
        'user_id' => /* WHAT DO I WRITE HERE? */,
    ];
});

What do I write for user_id ?

08 Mar
4 years ago

GianniGianni left a reply on [L5] Checkbok And Form::model

Since I'll have to use it in more than one form I'll go for the Middleware solution.

Thanks a lot everyone.

GianniGianni left a reply on [L5] Checkbok And Form::model

@dertechniker The problem is during the update. No value for checkbox is found in $request->all(), so the value is not modified in the Database

@frezno No, because the checkbox condition should be inside the $request->all() for my script to work

@kfirba I like your solution! I'll try it and let you know!

@bestmomo that's the quickest solution and it works! Even if it's not so elegant. I don't know if use yours or @kfirba 's one

GianniGianni started a new conversation [L5] Checkbok And Form::model

I am using a Form Request class to validate a form that has a checkbox.

If the checkbox is unchecked I can't get its value with $request->all() so the corresponding database field is not updated.

How can I get a checkbox value even if it's unchecked?

P. S. Someone suggested to add a Form::hidden('name', 0) before the checkbox but I don't like this solution.

18 Jan
4 years ago

GianniGianni left a reply on Refactor My Gulp.js File [L4] [Elixir]

Any idea? Any suggestion? I think there is a cleaner way to achieve the same result. But what?

14 Jan
4 years ago

GianniGianni started a new conversation Refactor My Gulp.js File [L4] [Elixir]

This is my Gulpfile.js file

var elixir = require('laravel-elixir');

elixir(function(mix) {
    mix.sass("styles.scss")
        .copy("vendor/bower_components/jquery/dist/jquery.js",
            "app/assets/tmp/jquery.js")
        .copy("vendor/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js",
            "app/assets/tmp/bootstrap.js")
        .copy("app/assets/js/_custom.js",
            "app/assets/tmp/_custom.js")
        .scripts([
            "jquery.js",
            "bootstrap.js",
            "_custom.js"
        ], "app/assets/tmp")
        .version(["css/styles.css", "js/all.js"]);
});

It looks too much complicated for me, so I am probably missing something.

How would you refactor it? Any suggestion will be appreciated

04 Nov
4 years ago

GianniGianni left a reply on Where Are You All From?

Rome, Italy

I bet there's no need to add more words about Italy :) :) :)

24 Sep
4 years ago

GianniGianni started a new conversation Entity Order Instead Of ID In URL

(Sorry if the title is not appropriate)

I need to implement something similar to the episode mechanism here in Laracasts.

When I click on an episode (belonging to a serie) the url looks like

https://laracasts.com/series/SERIE_TITLE/episodes/2

Where 2 means the second episode of that serie (2 is not the id of the episode) What may I do? How do I create next and prev. buttons?

GianniGianni left a reply on Custom Pagination URL

@bashy Because If I want to add an episode in the middle of the serie I'll have to change all the following entries

@zofe I'll try this

GianniGianni left a reply on Custom Pagination URL

@bashy My previous post was not clear, sorry.

my goal is to implement something like episodes in laracasts. I don't need pagination. I tought to use pagination (with 1 element per page) just to have next and prev buttons out of the box! It was a trick!

Now I realized it can't work because of the url format

GianniGianni left a reply on Custom Pagination URL

@bashy What do you mean exactly?

I need to do something similar to the episode mechanism here in Laracasts.

When I click on an episode (belonging to a serie) the url looks like

https://laracasts.com/series/SERIE_TITLE/episodes/2

Where 2 means the second episode of that serie (2 is not the id of the episode)

At first I tought to use pagination to easily have next and prev. buttons by default, but now I have to think something else.

What may I do?

GianniGianni left a reply on New RHS SideBar

@Morgon LHS is the short for Left Hand Sidebar

BTW In which page is this sidebar? I can't see it!

23 Sep
4 years ago

GianniGianni left a reply on How To Auth To Temporarily Login As Different User (view From User/admin Perspective)

you can do something like

$user = User::find(1); //ore use your own way to gewt the user

Auth::login($user);

GianniGianni started a new conversation Custom Pagination URL

With the default laravel pagination my url looks like

mydomain.com/item?page=2

Is there a way to obtain something like

mydomain.com/item/2 or mydomain.com/item/page/2

Thanks :)

18 Sep
4 years ago

GianniGianni started a new conversation Encryption Key And Version Control

In laracasts videos we always pay attention not to push our secret keys and BD connection data; and that's right!

But no one remember about the Encryption Key in app/config/app.php

Is it ok to push it to github? Why don't we use an Environment Variable specifically for that too?

16 Sep
4 years ago

GianniGianni left a reply on Series Duration Time Wrongly Calculated

@bashy I think it should be presented in HH:MM:SS format

1.67 hours is equal to (elementary calculations) 1 hour 40 minutes 12 seconds

So in my opinion it sould be displayed as 1:40:12

GianniGianni started a new conversation Series Duration Time Wrongly Calculated

The total duration of a series is calculated wrongly as you can see here

http://postimg.org/image/4ymqypjrp/

I think thery are being treated as decimal numbers instead of times

11 Sep
4 years ago

GianniGianni left a reply on How To Theme Lavarel?

Version 1.* of way\generatora can also generate a complete scaffold for a given resource

GianniGianni left a reply on Bug In Forums In Case You Are "not Human"

btw I noticed that the "question" is always the same

GianniGianni left a reply on Events And Queues

@kreitje And if I want to do something else instead of sending a mail? Can I simply use Queue::push() inside the listener?? Is there a better way??

10 Sep
4 years ago

GianniGianni left a reply on Events And Queues

@ax3lst ok how do I use both events and queues together? Is there a lesson about that?

@thepsion5 I see your point and I totally agree. Can you give me an example of using both together? (I already know about Mail:queue() )

GianniGianni started a new conversation Events And Queues

Is it a good practice to mix together Event programming and queue?

For example: when a user signs-up into my site I fire up an event, one of the listeners is in charge of updating the database (e.g. whenUserRegistred );

is convinient to push the fired method (or class) into a queue and "wait" to be executed by itself?