alex_time

alex_time

Member Since 4 Years Ago

Experience Points
45,525
Total
Experience

4,475 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
555
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 10
45,525 XP
May
20
4 months ago
Activity icon

Replied to Scaling Laravel - Required Infrasturcture For A PaaS Application

@FIDELOPER - your course is REALLY interesting @fideloper ! Anyway I am wondering...having a unique load balancer as "gate" wouldn't possibly be a single point of failure? The only alternative I can think of is a round robin DNS on top of two (or more) infrastructures like the one you show in the serie...am I missing something or are there any other possible solutions?

Feb
11
8 months ago
Activity icon

Replied to [closed] Laravel 5.7 TDD Routes Flushed After First Test Method Executed

The problem was caused by the fact the I have multiple routes file that are required using require_once.

Now I have organized routes file in folder creating specific methods on RouteServiceProvider.

Thanks

Activity icon

Replied to [closed] Laravel 5.7 TDD Routes Flushed After First Test Method Executed

If I try to avoid the named route on the second method and post to the exact url I get a NotFoundHttpException, realizing that almost all routes are flushed after the first test method executed.

Activity icon

Replied to [closed] Laravel 5.7 TDD Routes Flushed After First Test Method Executed

public function test_1() {
    $this->assertTrue(true);
    $this->post(route('routename'), [])->assertStatus(404);
}

public function test_2() {
    $this->assertFalse(false);
    $this->post(route('routename'), [])->assertStatus(404);
}
# vendor/bin/phpunit tests/Feature/BasicTest.php --filter=test_1
# PASS
# vendor/bin/phpunit tests/Feature/BasicTest.php --filter=test_1
# PASS
# vendor/bin/phpunit tests/Feature/BasicTest.php
# ERROR
# Route [routename] not defined
Activity icon

Started a new conversation [closed] Laravel 5.7 TDD Routes Flushed After First Test Method Executed

I am facing a strange behavior trying to explore the TDD world. I have made two test methods on the same test class. Each test method is isolated from others, in fact if I need a user logged in I have to log a user in every test method.

Here the issue: during the first test method execution I can query routes as many time as I need and I also can post or get or patch as many times I need; but when the first test method execute is terminated and Laravel try to execute the second method, all named routes are gone. Trying to understand why, I noticed that all the routes are completely flushed after the first test method and I cannot resolve any routes after the first test method. Even ifI try to post to a full path I get a Missing Route Exception.

If I try to filter the test method to execute, in that case the test work (and pass) with no problem, indicating that there is no issue with the test method itself, the problem is when I try to use the second test method only after a call the the very first is completed.

Oct
28
2 years ago
Activity icon

Replied to Cannot Get Data Posted By Vue Js Generated Fields

Oh my Goodness! I now actually see the nested form! Sorry guys! It is unbelievable that after one day looking at that form I now see the second form inside the template! Sorry! Sorry! Sorry!

Activity icon

Replied to Cannot Get Data Posted By Vue Js Generated Fields

@edoc On my local environment I post the form to a Laravel post route and dd($_POST), what I get is only:

array:3 [▼
  "_token" => "dg04kWWGDm4Iyxe32j7Kb6FGTNNWf99sXVpPcXuY"
  "progressive_number" => ""
  "note" => ""
]
Activity icon

Replied to Cannot Get Data Posted By Vue Js Generated Fields

Even if I move the template outside the form (if this is what you meant when you said that forms can't be nested), I can't get the data posted. Can you please be more clear about the mistake I make?

Activity icon

Replied to Cannot Get Data Posted By Vue Js Generated Fields

Why nested? There is only one form. What should I change to make it work again?

And as I said, the strange thing is that that very same cod worked until the 26th of October.

Oct
27
2 years ago
Activity icon

Replied to Cannot Get Data Posted By Vue Js Generated Fields

This is the template that actually worked, I am using Vue 1.0.20

When I submit the form containing this component I can no longer access data on the $_POST global array (nor the request laravel class)

Here's a feed http://jsbin.com/mewoweguwo/edit?html,js,output

If you try to use that feed you will notice that posting that form you don't get any data generated by vue

Activity icon

Started a new conversation Cannot Get Data Posted By Vue Js Generated Fields

Since yesterday (I have not even touched my code), using Chrome and Firefox I can no longer get data posted about all the fields that are generated by vue js using a v-for directive!

Vue dev tools, before posting data, looks fine as always, with all the data ready to send, but after submitting the form all my rules validation fail and if I die and dump even the entire $_POST array all the vue js generated fields are disappeared.

Do you have any idea on what is going on?!

Jul
16
3 years ago
Activity icon

Replied to Pusher Don't Recive My Events

For me the problem was the cluster that must be defined

Activity icon

Replied to Pusher Don't Recive My Events

I have also tried directly avoiding event broadcasting system, like this:

$pusher = new Pusher(
        config('broadcasting.connections.pusher.key'),
        config('broadcasting.connections.pusher.secret'),
        config('broadcasting.connections.pusher.app_id'),
        array('encrypted' => true)
    );
    $data['message'] = 'hello world';
    $pusher->trigger('test-channel', 'event-name', $data);

But it does not work anyway with no error at all!

Activity icon

Replied to Pusher Don't Recive My Events

Same to me...no way to communicate to pusher from laravel. I tried to start from scratch with a new project, no log errors and no connection...

Jul
14
3 years ago
Activity icon

Started a new conversation Valet And Eloquent Casts

I've got a very strange behavior using valet yesterday. I have a decimal type on my DB (maria Db), not unsigned, representing a money value (with 4 decimals) when I access it through the eloquent model (without any casts) the value will be converted to string but I can, anyway, make only some math operation on it. If I make a subtraction to that value it works only until the result it is zero, it won't go below zero. So I tried to casts to a float on eloquent model, var_dump says the type it is still string and if I make a subtraction still I can't go below zero... Another strange behavior is that if I echo out a negative decimal DB value on blade (always accessing it through the eloquent model) all negative numbers will be printed between parenthesis and not wight the minus sign. My locale is set to "it" and the fallback to "en". What it's more strange is that if I run the very same project using homestead and not valet all works fine (subtraction will go below zero, negative number will be represented with minus sign, etc) and all without having to use the casts definition. Does anyone has ever experienced something like this?!

Jul
10
3 years ago
Activity icon

Replied to Config/broadcasting.php File Missing

Thanks @martinbean I am coming from a previous version and I checked and followed the upgrade guide. The the guide anyway did not tell to add that specific file.

Now I am wondering if I have to update all the app file to the newer version...

Thanks again for your help, I didn't realised that during the upgrade the app directory remain untouched.

Jul
09
3 years ago
Activity icon

Started a new conversation Config/broadcasting.php File Missing

Even if

php artisan -V

confirms that I'm on

Laravel Framework version 5.2.22

I cannot find the config/broadcasting.php file. Why during the upgrade that file has not been pulled in? And can I just create it?

Mar
29
3 years ago
Activity icon

Started a new conversation Validation On Netested Elements

Prior to update to the latest Laravel 5.2.25 I was able to validate nested fields using the * symbol. What I mean is, if I have nested fields like this:

input name="person"
input name="person[children][0][name]"
input name="person[children][0][children][0][name]"

I was able to validate ALL the names of each child using a single rule like this, no matter of the nested level:
'person.*.name' => 'required'
But now, after update to Laravel 5.2.25 the rule validation above it does not work as before as I was expecting, and to make it works only on the very first nested level I have to write the rule like this:
'person.children.*.name' => 'required'

This means that I should write a rule for each level, but I do not know how deep the user will be filling the data, so this approach is not right. I would like to restore the previous behavior, no matter how deep I am on the tree I always want the name to be required. Do you know why the validation logic has changed? And how can I restore, maybe with a custom validation, a validation that go deep to the entire tree?

Dec
11
3 years ago
Activity icon

Started a new conversation Send Back All Inputs As Json On Error

I am playing with vue Js, I have created a simple form that allows me to clone a couple of fields over and over; all the fields are required and when, in case of error, I am redirected back by the Request class I have created and it is injected on the controller, I do not know how recreate and repopulate all the fields that I are originally created on the fly by Vue. Is there any way to transform all the old inputs as a json object?

Nov
23
3 years ago
Activity icon

Started a new conversation One Instance For One Task Or One For All?

All the screencast Jeffrey has made are REALLY great but, I cannot figured out a best practice about two things:

  1. When I have two or more different tasks to approach on the very same page, I would like to have one vue instance for each one, but I have problems when they are nested, my real case is: a page with a h1 title and a form, I have created a simple vue instance to bind the first form field with the h1 title so the vue "namespace" is the entire div containing h1+form+all_inputs; then I have another vue instance on a sub div element containing only two of the inputs which are related one another, but the first vue instance that "contains" the second one have precedence over the vue "child" and the child does not work, also the data property are erased by the first one, how can I solve this?
  2. I have written a couple of different vue instance on different files because I wanted to call theme according to the page that is requested by the user, but how can I load one specific vue js file only on one specific page? I am using elixir and all my scripts are merged together right now.
Nov
19
3 years ago
Activity icon

Replied to Input Text Value Based On A Related Select

Thanks, @mr415, it is cleaner on vue, or at least more structured, but how can I "inject" the suggestedCommissions object on vue file from my controller? My vue code it is in another js file and not hardcoded inside the view inside a script tag. I have seen a package made by Jeffrey on github to pass data from L5 to Js (https://github.com/laracasts/PHP-Vars-To-Js-Transformer), do you think it would be a good approach? I have used it once but maybe there is a cleaner way to do that, I am a real newbie on js...

Nov
18
3 years ago
Activity icon

Started a new conversation Input Text Value Based On A Related Select

I have a Product and a Category model, a product has a commission field and it belongs to a category, the related category has a suggested_commission field, this is the migrations:

Schema::create('categories', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name');
    $table->decimal('suggested_commission', 5, 4);
    $table->timestamps()
});

Schema::create('products', function (Blueprint $table) {
    $table->increments('id');
    $table->integer('category_id')->unsigned()->index();
    $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade')->onUpdate('cascade');
    $table->string('name');
    $table->decimal('commission', 5, 4);
    $table->timestamps()
});

On the view for creating a new product I have to select the category using a select having $category->id as value and $category->name as option text, but also I need the product->commission field to be equal to the suggested_commission value based on the selected category.

My idea is to create one hidden text input containing the suggested_commission value for each select option, and using jQuery I would create an onChange listener to the select, get the selected option value, get the related suggested_commission value from the hidden input and update the product->commission input, something like this:

<input type="hidden" name="suggested_commissions[1]" id="suggested_commissions_1" value="5">
<input type="hidden" name="suggested_commissions[2]" id="suggested_commissions_2" value="10">
<input type="hidden" name="suggested_commissions[3]" id="suggested_commissions_3" value="15">
<select name="category_id" id="category_id">
    <option value="1">Cat. 1</option>
    <option value="2">Cat. 2</option>
    <option value="3">Cat. 3</option>
</select>
<input name="commission" type="text">
<script>
# basically something like:
$('#category_id').change(function(){
    var selected_category = $('#category_id option:selected').val();
    var suggested_commission = $('#suggested_commissions_'+selected_category).val();
    $('#commission').val(suggested_commission);
});
</script>

But I was wondering if there is a more elegant way to accomplish that using Vue and not jQuery, and I also would like to avoid to create one hidden input for each select option, avoiding also an Ajax request to the server only to get the category json response from Laravel.

What do you think about all this stuff??

Jul
25
4 years ago
Activity icon

Replied to LiveReload On PHPStorm

I have seen that but it does not work with PHP file, only html, css and JS, while the Sublime LiveReload plugin works on PHP file too

Activity icon

Started a new conversation LiveReload On PHPStorm

I see that Jeffrey has used a Sublime plugin on the "Mass User Settings" series, does anyone know to get the same result on PHPStorm? Does anyone has tried the LiveReload app on Mac App Store?

Apr
09
4 years ago
Activity icon

Replied to Video Player, Upload And Hosting

It was a problem of account type, it is not possibile to do what I want with basic account, a plus or pro account it is necessary. thanks @erozas for your help.

Apr
08
4 years ago
Activity icon

Replied to Video Player, Upload And Hosting

@erozas Before making a decision I have done some testing today, I have generated a new app on Vimeo API and a valid token to be used on my development server. I have uploaded a couple of videos and, even if I cannot still upload anything for the three business days delay I guess (this is what Vimeo says on FAQ), I can request all the videos and get the json ready to be parsed, the problem is that all the videos on Vimeo must be private (and they are right now), but they cannot be seen by the user. If I render a view that simply parse the

Vimeo::request('/me/videos', ['per_page' => 10], 'GET');

and I echo the $data['body']['data'][index]['embed']['html']

Vimeo ask the user to log in in order to view theme, while I wish Vimeo use the token (and they use it because if I delete it an exception will be thrown) to use my user as the login user, and not ask the visitor to have a Vimeo account, and even if the visitor has an account he won't see anything because of the private video.

Here in laracast all the video must be private in order to not be visibile without subscription, but laracast does not ask me to log in to vimeo in order to watch videos...so there is some concept I am missing I guess. Have you ever faced a situation like this? I thought that using the vimeo token would let the app "been seen" by Vimeo as the Vimeo user associated with the token...but I am wrong... @JeffreyWay maybe knows something about all this stuff ;)

Activity icon

Started a new conversation Video Player, Upload And Hosting

My company asked me to create an app to publish videos that must be seen by employees, so I basically have to:

  1. create an upload video system (I will not be the only one to upload video otherwise I could simply use ftp or sftp and do things manually, but for others I should create a simple web interface);
  2. track down users so to be sure that everyone has seen the entire videos that they have to;
  3. does not allow users to see videos that they cannot see.

Now I have some doubts:

  1. upload without flash means I have to raise up values on php.ini, but is it safe to put those level so high? And even if I get more RAM on server, does exist a system to track upload progress on laravel? I have written long time ago a system to track upload progress using PHP Session upload progress, maybe I can use the same approach, or L5 offers something better or out of the box?
  2. I think I can do ajax request during playback to log what the user have seen, do you have better suggestion?
  3. will be better to leave videos on an external provider or upload everything on our own server? Using our own server is it possibile (how?) to create temporary link to the videos and lock only that user on that session to access that temporary link and see that specific video? If I create a dynamic link stored in a table with an expirations system, in this case that link will be available for everyone I guess, how would you solve that?
Mar
30
4 years ago
Activity icon

Replied to Conditional Form Fields

@bestmomo and all the added field were completely lost? Because this is the biggest problem on that approach. My "spaghetti-code" like classes were able to reconstruct the entire form, including all the fields added using JS and all the content and finally hide all the unnecessary fields, this is what I am trying to solve in Laravel and I do not know even where to start...

Activity icon

Replied to Conditional Form Fields

@bestmomo is that page published and accessible for visit it and view all in action? When the user fails a validation rule and he's redirected back, does laravel create again all the answer fields generated by jquery?

Activity icon

Replied to Conditional Form Fields

@bestmomo do you have any example to that approach? Maybe a laracast video or something that can explain more what you usually do?

Activity icon

Started a new conversation Conditional Form Fields

Back in my spaghetti-code I written a class that could handle conditional forms, I could, for example, ask the user if he/she was a male or female and based on that choice display (using js) some specific fields and than apply conditional validation based on the choices. Switching to L5 I know I can benefit from the new validation method where I can put logic in it, and I could write specific js on assets but there is still a problem: failing a validation in L5 mean a switch back to the previous page with precompiled fields, but if I apply js code to display a subset of fields based on other fields I guess that L5 will compile all the filds that were compiled before but I cannot handle all the show/hide actions to display the form like it was before. How do you handle such situations?