andreich1980

andreich1980

Member Since 2 Years Ago

Bryansk

Experience Points 87,430
Experience Level 18

2,570 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 704
Lessons
Completed
Best Reply Awards 24
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.

12 Jul
1 week ago

andreich1980 commented on Inline SVGs Using Render Functions

Aren't you missing a space in the regular expression at 0:35?

I think it should be <svg title='${achievement.description}'<SPACE>

andreich1980 left a reply on Connecting To Remote MSSQL Server From Homestead V7.9.0

Thanks @imni It works great.

P.S. I set DB_PORT to 1433.

09 Jul
1 week ago

andreich1980 commented on How To Dynamically Inline SVG Files In Vue Components

Too high resolution for a video lesson. But still great approach!

02 Jul
2 weeks ago

andreich1980 commented on Drop Down A Level

What kind of black magic is this? You make 2 typos, run tests, get green, return to the code and the typo is fixed :D I'm speaking about forgotten ) in two places

andreich1980 commented on Drop Down A Level

Haha, look for the latest Whatcha you working on lesson.

28 Jun
3 weeks ago

andreich1980 commented on Be Strict With Your Controllers

Wow, nice native comments!

23 May
1 month ago

andreich1980 left a reply on Help Transforming Collection

Just map through the collection and modify the result as you wish with map

andreich1980 left a reply on My System Runs A Script That Isn't There

Nobody could guess what is going on without any of the code provided. All seers are on vacation :D

andreich1980 left a reply on 'Call To Undefined Method Illuminate\Database\Query\Builder::isAccount()'

Do you have the method in your User model? Could you show it?

andreich1980 left a reply on Resource Links Next And Prev

RTFM, https://laravel.com/docs/5.8/pagination

There you'll see Appending To Pagination Links

{{ $users->appends(['query' => 'params'])->links() }}
21 May
2 months ago

andreich1980 left a reply on Implementing 3 Types Of Users

Do they really need to be in different tables?

Maybe you can store them all in users with diferent roles. You could even create separate Models for them if you want.

andreich1980 left a reply on Prefix Route Problem

Route prefixes has nothing to do with "directories in public folder".

remove or rename dashboard directory from your public directory

check DashboardController authorization - maybe there's a policy or something else that needs you to have a specific role to open the route.

So you would show your DashboardController

16 May
2 months ago

andreich1980 left a reply on How To Give Permission To Public Folder To Store Image.

You shouldn't save files to the public directory directly. Save them to the storage/app/public and make a symlink as described here https://laravel.com/docs/5.8/filesystem

andreich1980 left a reply on How To Send Report In In Scheduled Time

You extract report logic from the controller method to a job.

Then dispatch the job in the controller method.

And call the job in the scheduler task.

15 May
2 months ago

andreich1980 left a reply on Schedule A Job From A Controller?

The given advice is quite good.

andreich1980 left a reply on Images Uploaded In Storage Not Accessible

@ELO - Try something like this. Add it to a temporary /test route.

symlink('/home/username/public_html/storage', '/home/username/public_html/storage/app/public');

andreich1980 left a reply on How To Add Pagination To This Code

get method returns a collection. I think you should paginate it before calling get.

$files = $files->latest('created_at')->paginate();

andreich1980 left a reply on Images Uploaded In Storage Not Accessible

you should run php artisan symboli:link at the shared hosing as well.

andreich1980 left a reply on Error 404

your url is wrong. All the possible urls are at the pic https://appdividend.com/wp-content/uploads/2019/03/Laravel-5.8-CRUD-Tutorial-.png what do you expect to see? books list or a book? for books list it is localhost:81/books, for a specific book it would be localhost:81/books/1

13 May
2 months ago

andreich1980 left a reply on Homestead Per Project Installation

Yes it's required. Your browser sends a request to homestead.test but there's no such a website and if you haven't added it to the hosts the browser will tell you that the website does not exist.

Have you added the IP and the domain name to your host's hosts file? It must he your host's machine hosts file

andreich1980 left a reply on @push And @stack Don't Seem To Load Javascript

Do you have $(document).ready(function () { ... }) as it is described here? https://github.com/HemantNegi/jquery.sumoselect#usage

05 Apr
3 months ago

andreich1980 left a reply on A Package With Jobs

Well, pulled orchestral/testbench, tweaked my tests and some code and it worked like a charm.

04 Apr
3 months ago

andreich1980 left a reply on A Package With Jobs

I tried to downgrade all the dependencies to 1.1 but it didn't work for illuminate/container, because it depends on illuminate/notifications that doesn't have 1.1 version at all

andreich1980 left a reply on A Package With Jobs

@MARTINBEAN - My package is for fresh laravel version (5.8, maybe 5.7, probably it will work with older versions as well) I did composer require --dev illuminate/config=~5.8 then composer require --dev illuminate/foundation and got the same error

illuminate/foundation v1.1.2 requires illuminate/config 1.1.* -> satisfiable by illuminate/config[v1.1.0] but these conflict with your requirements or minimum-stability.

Do you mean I should install 1.1 version of config?

andreich1980 started a new conversation A Package With Jobs

I'm creating a package that should use a job. The job looks like this

<?php

namespace Vendor\Package\Jobs;

use Illuminate\Foundation\Bus\Dispatchable;

class VerifyProxy implements ShouldQueue {

    use Dispatchable, ...;

    ...
}

To test my package I composer require --dev some pachages listIlluminate/database, illuminate/config. Now it seems that I need to pull the illuminate/foundation as well. But it doesn't work

$ composer require --dev illuminate/foundation
Using version ^1.1 for illuminate/foundation
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - illuminate/foundation v1.1.2 requires illuminate/config 1.1.* -> satisfiable by illuminate/config[v1.1.0] but these conflict with your requirements or minimum-stability.
    - illuminate/foundation v1.1.1 requires illuminate/config 1.1.* -> satisfiable by illuminate/config[v1.1.0] but these conflict with your requirements or minimum-stability.
    - illuminate/foundation v1.1.0 requires illuminate/config 1.1.* -> satisfiable by illuminate/config[v1.1.0] but these conflict with your requirements or minimum-stability.
    - Installation request for illuminate/foundation ^1.1 -> satisfiable by illuminate/foundation[v1.1.0, v1.1.1, v1.1.2].


Installation failed, reverting ./composer.json to its original content.

I looked it up and noticed that the package is marked as abandoned.

How can I solve this?

03 Apr
3 months ago

andreich1980 left a reply on Coding Help Required!

I think you should share the errors.

andreich1980 started a new conversation The Gap On The User Sidebar

I really like the new design but there's one thing that hurt my eyes every day. https://imgur.com/a/NqYlZAx

28 Mar
3 months ago

andreich1980 left a reply on How To Run Artisan Commands On A Shared Host

It's just fantabulous.

I found an option in my hosting panel: disabled_function and there was some of them like exec, shell, including proc-open. So I just removed it and it all works :)

01 Mar
4 months ago
27 Feb
4 months ago

andreich1980 left a reply on How To Create Plugins For My App?

maybe it should be composer packages?

12 Dec
7 months ago

andreich1980 left a reply on Model Alias - 'Members' Vs. 'Users'

$member->groups gives you all the groups the $member is in.

andreich1980 left a reply on Check If Input Value Before Update

I guess Eloquent does it automatically - you can set values to the model and call save(). If nothing has been changed it won't really hit the database.

11 Dec
7 months ago

andreich1980 left a reply on Pop Up Box With Javascript

or maybe you would like something like this? https://sweetalert2.github.io

andreich1980 left a reply on Pop Up Box With Javascript

@DAVY_YG - does it work? do you see the alert with 'success' text? is this what you want?

andreich1980 left a reply on Pop Up Box With Javascript

you would add a div with absolute positioning. https://www.w3schools.com/howto/howto_css_modals.asp

andreich1980 left a reply on Store Method In API

@FATIMA1 - depends on a technology you're using

andreich1980 left a reply on How To Set Every Row On Table To The Same Value

Isn't it a duplicate for the https://laracasts.com/discuss/channels/laravel/update-row-of-database-on-laravel

my answer from there

There must be a query with a join between orders and inventories (or whatever the table name is), then you would add a where like this ->where('orders.user_order_id', '=', DB::raw('inventories.user_id')) and then call ->delete()

andreich1980 left a reply on Store Method In API

If you want to send the request with PHP - use Guzzle package. If you use Vue/JS - use axios or a vanila JS ajax request.

Or I didn't understand your question

andreich1980 left a reply on Store Method In API

Should project B use the API of the project A?

andreich1980 left a reply on Update Row Of Database On Laravel

There must be a query with a join between orders and inventories (or whatever the table name is), then you would add a where like this ->where('orders.user_order_id', '=', DB::raw('inventories.user_id')) and then call ->delete()

10 Dec
7 months ago

andreich1980 left a reply on How To Display Name In Nav Bar From Db

{{ auth()->user()->personal_details->first_name

andreich1980 left a reply on HTML5 Validation Multiple Forms

@petritr would you provide more info about your business process here? what are you going to do?

It's all a bit confusing.

You have a number of forms on the page. Then you do what? Click on a submit button in one of the forms? Then validate the form and submit it?

andreich1980 left a reply on HTML5 Validation Multiple Forms

I think the problem is you can't use the same ID for different elements. You would change #save_device to .save_device as well as #submit-new-hidden.

And then change your forms declaration to <form class="save_device">. The same with buttons.

andreich1980 left a reply on Very Weird Behavior On Deleting A Model

You forgot each for tasks.

06 Dec
7 months ago

andreich1980 left a reply on Conditional Validation For LoginController

You need to know how many attempts login user failed. Then you would decide shoud captcha be required or not.

Yes, you can do it this way

$request->validate([
    'name' => ($name) ? 'required' : 'nullable'
]);

or like this

$rules [
    'name' => 'required',
];

if ($loginAttemts >= 3) {
    rules['captcha'] = 'required';
}

$request->validate($rules);
30 Nov
7 months ago

andreich1980 left a reply on Video Tutorial

check you browser console for any errors

andreich1980 left a reply on Is It A Bad Idea To Populate A Table With Default Data From Migration Files?

I do my seeders with firstOrCreate. So I can run the seeder as many times as I want

andreich1980 left a reply on Socialite: Merge Accounts That Have The Same Email

If I'm not mistaken Socialite does nothing with your database. It only redirects you to the website (FB, GitHub), and then catches when you are redirected back with authenticated user data.

It's up on you what do you do with the data.

Of course you can look for a user by the email from a provider and only if you don't have one - create a brand new user.