andreich1980

andreich1980

Member Since 2 Years Ago

Bryansk

Experience Points 84,530
Experience Level 17

470 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 683
Lessons
Completed
Best Reply Awards 23
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.

21 May
1 day 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
6 days 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
1 week 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
1 week 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
1 month 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
1 month 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
1 month 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
1 month 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
2 months ago
27 Feb
2 months ago

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

maybe it should be composer packages?

12 Dec
5 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
5 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
5 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
5 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
5 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.

28 Nov
5 months ago
23 Nov
5 months ago

andreich1980 left a reply on Laravel Observer Created

dd($clientProduct->exists)?

andreich1980 left a reply on Laravel Observer Created

How do you know it is not saved?

andreich1980 left a reply on Save Calendar's Event With Photo (two Tables)

Where do you get photos for the select form field?

andreich1980 left a reply on Send Email Alert At 90% Usage Only Once (best Practise?)

You can skip users, who has usage_notification_sent_at filled, from checking

andreich1980 left a reply on Send Email Alert At 90% Usage Only Once (best Practise?)

Or a separate table sent_notifications if you have more that 1 notification type to send.

andreich1980 left a reply on Send Email Alert At 90% Usage Only Once (best Practise?)

usage_notification_sent_at column? in the users table?

andreich1980 left a reply on A Error In Laravel-5-boilerplate

@MDELSHAD - you have to add use App\Models\Article\Article; on the top of the file App\Models\Article\Traits\Relationship\ArticleRelationship.php. You are using User model but haven't imported one.

andreich1980 left a reply on A Error In Laravel-5-boilerplate

Hey bro. The error looks like you missed use App\Models\Article\Article; in a file inside of App\Models\Auth\Traits\Relationship. That's exactly what happens when you forget to import a class - it tries to find the class in the same namespace.

So, go through all the files inside App\Models\Auth\Traits\Relationship (or, all files that have this namespace) and check wheither or not you're using Article model in the files and if you do - check that it has use App\Models\Article\Article; at the top of the file.

andreich1980 left a reply on Axios To Delete An Array From Database?

@AHPENGGGGG - Ok, it was confusing when you were talking about "deleting a single array"