alex_giacholari

alex_giacholari

Hire Me

Member Since 2 Years Ago

Experience Points 77,540
Experience
Level
Lessons Completed 753
Lessons
Completed
Best Reply Awards 0
Best Answer
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.

03 Aug
4 months ago

alex_giacholari left a reply on Retrieve Models Depending On Related Models State.

Would that work for partial?

Notification::whereHas('messages', function($q) { $q->where('is_sent', true);}, '<',3 )->whereHas('messages', function($q) { $q->where('is_sent', true); }, '>', 1)->count()

alex_giacholari left a reply on Retrieve Models Depending On Related Models State.

Yes, you are right. The partial query gets me the sent as well.

alex_giacholari left a reply on Retrieve Models Depending On Related Models State.

That is correct it depends on the messages. If all messages are sent the notification is complete

alex_giacholari left a reply on Retrieve Models Depending On Related Models State.

Thank you guys for the replies. @aurawindsurfing I am using true or false 1 or 0 so I cannot implement it the way you are describing. @tykus Your solution partially works. When I mark a notification as sent it appears both in partial and sent results. The same applies when I mark a notification as partial. It appears both in partial and not sent.

alex_giacholari started a new conversation Retrieve Models Depending On Related Models State.

I have a Notification and Message class. A notification has many messages. The messages table contains a field is_sent (bool). I want to retrieve all notifications where all related messages is_sent field is true, false or partially done. So partially means if a notification has three messages then only 1 or two are sent not all. How can I produce such a query?

25 Jul
4 months ago

alex_giacholari left a reply on Use Different Class When Testing

@CJJ Iam not very familiar with mocks ... Could you provide an example?

alex_giacholari started a new conversation Use Different Class When Testing

I have and SMS class that among other things, it sends an SMS to a customer. What is the best way to call that send method without actually sending a message for real? How do I test that class?

Thank you

23 Jul
4 months ago

alex_giacholari left a reply on Laravel Vue Axios Is Action Method And Csrf Needed For Ajax Forms

When using axios you specify the endpoint and I guess as a second argument you pass the data you want to post. This is an example :

axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });

20 Jul
4 months ago

alex_giacholari left a reply on Laravel Vue Axios Is Action Method And Csrf Needed For Ajax Forms

You do not need to specify the csrf_field when using axios and Vue. Everything is already set up in your bootstrap.js file.

05 Jun
6 months ago

alex_giacholari left a reply on Scheduling Commands

Yeah you were right guys. The command in my end would not run because it was throwing an exception. So to sum up, if a command takes too long to execute the upcoming commands will still run later if there are no errors in the previous one. As you said before using a try catch could be more appropriate in order to handle such situations. In addition to that when using dailyAt make sure to set the time based on the UTC format.

04 Jun
6 months ago

alex_giacholari left a reply on Scheduling Commands

Is that working fine when you use dailyAt('time')?

alex_giacholari left a reply on Scheduling Commands

$schedule->call(function () { echo 'sleep 120 seconds' . PHP_EOL; sleep(120); })->everyMinute(); //21:50

//create a command and call it here $schedule->command('command:name')->dailyAt('21:50'); // use UTC time

alex_giacholari left a reply on Scheduling Commands

Yeah but what I am saying is that the second command won't even run at all.

alex_giacholari left a reply on Scheduling Commands

If you do the following I find that it fails :

$schedule->call(function () { echo 'sleep 120 seconds' . PHP_EOL; sleep(120); })->everyMinute();

$schedule->command('command:name')->dailyAt('time');

where time = same time as previous $schedule->call.

alex_giacholari left a reply on Scheduling Commands

It fails though when you use dailyAt.

alex_giacholari left a reply on Scheduling Commands

Yeap you right! On that note I also noticed that if a command fails it will not execute any other predifined commands ... Is there any way I can carry on executing the rest of the commands?

alex_giacholari started a new conversation Scheduling Commands

There is a command I run via the Illuminate\Console\Scheduling\Schedule class in the the Kernel.php file daily at a specific time. I also have other commands that I trigger every x minutes. My question is if any of the other commands takes a lot of time to execute will the command I specified to run at a certain time get the chance to run at all??

20 Apr
7 months ago

alex_giacholari left a reply on Git Bash Weird Characters

Thank you for the replies. @Cronix I'll try to do that.

alex_giacholari left a reply on Git Bash Weird Characters

Yeah! that is working. How do I configure so I do not have to do that every time?

alex_giacholari started a new conversation Git Bash Weird Characters

On windows 10, when I run php artisan on my project, I get weird characters on the terminal such as ?? all over the place.

12 Mar
9 months ago

alex_giacholari left a reply on Composer Install Fails

So how would you deal with data that need to be shared across multiple pages?

alex_giacholari left a reply on Composer Install Fails

Yes and it was trying to query the channels table but the database was not migrated yet.

10 Mar
9 months ago

alex_giacholari left a reply on Vue Components Doesn't Update On Shared Hosting Server

In theory you could, given you have installed all of the dependencies, but as I said that is not a good practice.

alex_giacholari left a reply on Vue Components Doesn't Update On Shared Hosting Server

Yeah, what you would do normally is push your code to github and whenever you need to work on that you clone the repository on your local computer and then you start programming. Once you feel that you have done some work that you want to push online, you do it from your local computer. Normally you would have multiple branches and you would push to a specific one. Once a feature is ready you merge it with the main branch and then push that to the remote server.

alex_giacholari left a reply on Vue Components Doesn't Update On Shared Hosting Server

It seems to me that you are duplicating work. What I would do is compile the assets locally and then push it online to show it to people. However compiling and editing should be done on the development environment not on the remote server..

alex_giacholari left a reply on Vue Components Doesn't Update On Shared Hosting Server

Did you run composer install and npm install ?

alex_giacholari left a reply on Vue Components Doesn't Update On Shared Hosting Server

Run the following command before deploying your code --> npm run dev

alex_giacholari left a reply on Composer Install Fails

Found the error. To fix this add the following code to the AppServiceProvider :

public function boot() { if (Schema::hasTable('channels')) { \View::share('channels', Channel::all()); }

}

alex_giacholari left a reply on State Of UI

Here is the code -->

Event
    <dt class="col-sm-3">What did I learn?</dt>
    <dd class="col-sm-9">
        <textarea v-model="learned"></textarea>
    </dd>

    <dt class="col-sm-3">What went well?</dt>
    <dd class="col-sm-9">
        <textarea v-model="well"></textarea>
    </dd>

    <dt class="col-sm-3">What could I have done better?</dt>
    <dd class="col-sm-9"> 
        <textarea v-model="better"></textarea>
    </dd>

    <dt class="col-sm-3">Implications</dt>
    <dd class="col-sm-9"> 
        <textarea v-model="implications"></textarea>
    </dd>
    <button class="btn btn-primary mr-1" @click="update">update</button>
    <button class="btn btn-light" @click="cancel">cancel</button>
</dl>

<dl v-else class="row  journal-item p-2">
    <dt class="col-sm-3">Event</dt>
    <dd class="col-sm-9" v-text="event"></dd>

    <dt class="col-sm-3">What did I learn?</dt>
    <dd class="col-sm-9">
        <p v-text="learned"></p>
    </dd>

    <dt class="col-sm-3">What went well?</dt>
    <dd class="col-sm-9">
        <p v-text="well"></p>
    </dd>

    <dt class="col-sm-3">What could I have done better?</dt>
    <dd class="col-sm-9"> 
        <p v-text="better"></p>
    </dd>

    <dt class="col-sm-3">Implications</dt>
    <dd class="col-sm-9"> 
        <p v-text="implications"></p>
    </dd>

    <button class="btn btn-secodary" @click="editing = true">edit</button>
    <button class="btn btn-danger ml-1" @click="remove">delete</button>
</dl>
export default {
  props : ["journal"],

data () {
      return {
          event: this.journal.event,
          learned: this.journal.learned,
          well: this.journal.well,
          better: this.journal.better,
          implications: this.journal.implications,
          id: this.journal.id,
          editing: false,
      }
  },

methods: {
    cancel() {
        this.editing = false;
        
        this.event = this.journal.event;
        this.learned = this.journal.learned;
        this.well = this.journal.well;
        this.better = this.journal.better;
        this.implications = this.journal.implications;
    },

    remove() {
        axios.delete('/journals/'+ this.id)
            .catch(error => {
                flash(error.response.data.errors.body[0],'danger');

            })
            .then(({data}) => {
                this.$emit('deleted', this.id)

                flash('deleted!');
        });
    },

      update() {
          axios.patch('/journals/'+ this.id, {
              event: this.event, 
              learned: this.learned,
              well: this.well,
              better: this.better,
              implications: this.implications
              })
                .catch(error => {
                        flash(error.response.data.errors.body[0],'danger');
                    })
                    .then(({data}) => {
                        this.editing = false;

                        flash('updated!');
                    });
      },

}

}
.journal-item { background-color: #FFFF66; font-family:Comic Sans MS; }

alex_giacholari started a new conversation State Of UI

Here is the problem. I have a list of journal entries that I render with VUE. Each entry is each own component. In the individual component I have a couple of methods and two of them are the update and the cancel methods. When I update and entry I just set the editing property to false, make a put-axios call and update the model in the DB and set the values dispayed to whatever the user updated them. This works fine. When I try to update and cancel it sets the values dispayed to whatever they were when they were first rendered. However, when I update the entry and I click update again and then cancel, the values displayed do not match those that the user updated but to whatever was first rendered. I do not know if that was the best explanation.. Does anyone know how to solve this?

02 Feb
10 months ago

alex_giacholari started a new conversation Order Stock Management System

Do you guys know any popular Laravel based CRM order/delivery/stock management system that is robust and well tested?

22 Jan
10 months ago

alex_giacholari left a reply on Cloud Based Database

So I guess the same answer applies to microservices as well.

alex_giacholari left a reply on Cloud Based Database

How do large corporations scale though? It seems to me unwise to just add more disk space isn't?

alex_giacholari started a new conversation Cloud Based Database

Is it good practice to use a cloud based database instead of a local database on the remote server? How do you guys approach such an issue? Thanks.

17 Jan
10 months ago

alex_giacholari left a reply on Composer Install Fails

Not sure about that. Randomly guessing now, but do you think the fact that I am using a view composer to retrieve some data in all of my pages causes this error somehow?

15 Jan
10 months ago

alex_giacholari started a new conversation Composer Install Fails

This is the error: SQLSTATE[08006] [7] could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

Any ideas?

10 Jan
11 months ago

alex_giacholari left a reply on CircleCI

That's great thanks. If I need to use phpunit I would just need to replace codecept and that would be it right?

alex_giacholari started a new conversation CircleCI

Can someone demo a circleci configuration file? Generally how do you setup a project on circleci and what do you need to add on the laravel end?

05 Jan
11 months ago

alex_giacholari left a reply on Shopping Cart With VueJS

Create a component called Cart and a component representing an individual product. In addition to that create also a products list component which is responsible for rendering all the individual products. Here you could pass form the backend the products variable as a property to the product-list component. Then each time a user clicks the add button on the product itself emit an event so that the Cart can pick up on that event and update itself by pushing the product to the array.

13 Dec
11 months ago

alex_giacholari left a reply on Review Site

fdafdsfsdf

12 Dec
1 year ago

alex_giacholari started a new conversation Let's Build A Forum With Laravel

Hi all. I have been watching the Let's build a forum with laravel series and I decided to build a similar web app on my own. It would be amazing if you guys could give me some feedback about the site, the overall look and the code itself. Thank you. The repository of the app can be found here : https://github.com/RomarioGiacholari/forum The link tothe site : http://www.discusslab.com/

alex_giacholari left a reply on Manifest.json

Your solution worked and thank's for replying. I found another alternative as well. I placed the manifest.json file directly into the public directory and I referenced it in the master layout file like this

11 Dec
1 year ago

alex_giacholari started a new conversation Manifest.json

Where shall I place the manifest.json file and how should I call it from the app.blade.php file?

10 Dec
1 year ago

alex_giacholari left a reply on Laravel Requires Zip

Can you paste the error?

14 Aug
1 year ago

alex_giacholari started a new conversation React Node Server Problem

I get this error when I do npm start

"scripts": { "start": "webpack-dev-server --hot" },

[email protected] start C:\Users\alex\desktop\Code\react-lessons\reactApp webpack-dev-server --hot

C:\Users\alex\desktop\Code\react-lessons\reactApp\webpack.config.js:6 filename: 'index.js', ^^^^^^^^ SyntaxError: Unexpected identifier at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at requireConfig (C:\Users\alex\Desktop\Code\react-lessons\reactApp\node_modules\webpack\bin\convert-argv.js:97:18) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: webpack-dev-server --hot npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\alex\AppData\Roaming\npm-cache_logs\2017-08-14T14_50_33_783Z-debug.log

13 Jun
1 year ago

alex_giacholari left a reply on Vendor Folder Missing

I actually solved the problem by enabling an extension on php.ini and running composer install.