alex_giacholari

Hire Me

Experience

74,740

0 Best Reply Awards

  • Member Since 2 Years Ago
  • 727 Lessons Completed
  • 2 Favorites

3rd August, 2018

alex_giacholari left a reply on Retrieve Models Depending On Related Models State. • 2 months ago

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. • 2 months ago

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. • 2 months ago

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. • 2 months ago

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. • 2 months ago

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?

25th July, 2018

alex_giacholari left a reply on Use Different Class When Testing • 2 months ago

Thank you @CJJ

alex_giacholari left a reply on Use Different Class When Testing • 2 months ago

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

alex_giacholari started a new conversation Use Different Class When Testing • 2 months ago

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

23rd July, 2018

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

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); });

20th July, 2018

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

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

5th June, 2018

alex_giacholari left a reply on Scheduling Commands • 4 months ago

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.

4th June, 2018

alex_giacholari left a reply on Scheduling Commands • 4 months ago

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

alex_giacholari left a reply on Scheduling Commands • 4 months ago

$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 • 4 months ago

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 • 4 months ago

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 • 4 months ago

It fails though when you use dailyAt.

alex_giacholari left a reply on Scheduling Commands • 4 months ago

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 • 4 months ago

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??

20th April, 2018

alex_giacholari left a reply on Git Bash Weird Characters • 5 months ago

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

alex_giacholari left a reply on Git Bash Weird Characters • 5 months ago

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 • 5 months ago

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

12th March, 2018

alex_giacholari left a reply on Composer Install Fails • 7 months ago

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

alex_giacholari left a reply on Composer Install Fails • 7 months ago

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

10th March, 2018

alex_giacholari left a reply on Vue Components Doesn't Update On Shared Hosting Server • 7 months ago

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 • 7 months ago

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 • 7 months ago

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 • 7 months ago

Did you run composer install and npm install ?

alex_giacholari left a reply on Vue Components Doesn't Update On Shared Hosting Server • 7 months ago

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

alex_giacholari left a reply on Composer Install Fails • 7 months ago

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 • 7 months ago

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 • 7 months ago

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?

2nd February, 2018

alex_giacholari started a new conversation Order Stock Management System • 8 months ago

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

22nd January, 2018

alex_giacholari left a reply on Cloud Based Database • 8 months ago

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

alex_giacholari left a reply on Cloud Based Database • 8 months ago

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 • 8 months ago

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.

17th January, 2018

alex_giacholari left a reply on Composer Install Fails • 8 months ago

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?

15th January, 2018

alex_giacholari left a reply on Composer Install Fails • 9 months ago

yes

alex_giacholari started a new conversation Composer Install Fails • 9 months ago

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?

10th January, 2018

alex_giacholari left a reply on CircleCI • 9 months ago

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 • 9 months ago

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?

5th January, 2018

alex_giacholari left a reply on Shopping Cart With VueJS • 9 months ago

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.

13th December, 2017

alex_giacholari left a reply on Review Site • 10 months ago

fdafdsfsdf

12th December, 2017

alex_giacholari started a new conversation Let's Build A Forum With Laravel • 10 months ago

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 • 10 months ago

alex_giacholari left a reply on Manifest.json • 10 months ago

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

11th December, 2017

alex_giacholari started a new conversation Manifest.json • 10 months ago

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

10th December, 2017

alex_giacholari left a reply on Laravel Requires Zip • 10 months ago

Can you paste the error?

14th August, 2017

alex_giacholari started a new conversation React Node Server Problem • 1 year ago

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

13th June, 2017

alex_giacholari left a reply on Vendor Folder Missing • 1 year ago

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

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.