Agelios

Agelios

Member Since 1 Year Ago

Lviv

Experience Points 13,370
Experience Level 3

1,630 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 88
Lessons
Completed
Best Reply Awards 7
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.

11 Mar
2 months ago

Agelios started a new conversation String To Mysql Point

i used inverse seed generator and get mysql point like this.

  \DB::table('locations')->insert(array (
            0 =>
                array (
                    'coordinates' => '' . "LARACASTS_SNIPPET_PLACEHOLDER" . '' . "LARACASTS_SNIPPET_PLACEHOLDER" . '' . "LARACASTS_SNIPPET_PLACEHOLDER" . '' . "LARACASTS_SNIPPET_PLACEHOLDER" . '' . "LARACASTS_SNIPPET_PLACEHOLDER" . '' . "LARACASTS_SNIPPET_PLACEHOLDER" . '' . "LARACASTS_SNIPPET_PLACEHOLDER" . '��[email protected] Z<u[email protected]',
                )
        ));

But i cant insert it SQLSTATE[22003]: Numeric value out of range: 1416 Cannot get geometry object from data you send to the GEOMETRY fie ld

Give me advice pls :)

23 Jan
3 months ago

Agelios started a new conversation Laravel Console Commands Option

Laravel doc https://laravel.com/docs/5.7/artisan#defining-input-expectations has description about options --option=. php artisan help make:controller show all options but in code any options not described. Where are they?

10 Jul
10 months ago

Agelios left a reply on Too Many Connections

I tried also use 'options' => [ PDO::ATTR_PERSISTENT => true ] in database config. I had 1 connection but also had error PDOException: There is already an active transaction

Agelios started a new conversation Too Many Connections

I have 170+ tests and after 152 i have error [1040] Too many connections In my tests i use DatabaseTransactions Tried write protected $connectionsToTransact = ['mysql_test']; and

protected function setUpTraits()
    {
        parent::setUpTraits(); // TODO: Change the autogenerated stub

        $uses = array_flip(class_uses_recursive(static::class));

        if (isset($uses[DatabaseMigrations::class])) {
            $this->beforeApplicationDestroyed(function () {
                $this->app->make('db')->connection('mysql_test')->disconnect();
            });
        }
    }

Perhaps someone already came across this and found a solution

27 Jun
10 months ago

Agelios left a reply on Why I Dont See Status?

@martinbean Its have more complex logic. I inserted only the necessary, so that you would understand my question, and answer I was looking for is $order->fresh()->status Thank you

Agelios started a new conversation Why I Dont See Status?

I have situation like this in my test and i dont understand how does it works

        $order = factory(Order::class)->create();
        $order->setStatus('status');

        $status = $order->status; // null
        $status = Order::find($order->order_id)->status; // find status

setStatus

public function setStatus($status, $timestamp = null)
    {
      
        return $this->status()->create([
            'status' => $status,
            'timestamp' => $timestamp
        ]);
    }

Or maybe you have cleaner solution how i can test it

01 Jun
11 months ago

Agelios left a reply on Session Id Changed

I solved the problem. Ty for all... Maybe someone will need it in the future

protected $session_id;
    protected $session_cookie;

    public function setUp()
    {
        parent::setUp();

        $this->session_id = session()->getId();
        $this->session_cookie = [session()->getName() => encrypt($this->session_id)];
    }
    public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
    {
        $cookies = array_merge($cookies, $this->session_cookie);
        return parent::call($method, $uri, $parameters, $cookies, $files, $server, $content);
    }

the problem was in cookie. Laravel need cookie which they can decrypt. And our call method needed to return parent::call()

Agelios left a reply on Session Id Changed

I tried to rewrite call method

public function setUp()
    {
        parent::setUp();

        $this->session_id = session()->getId();
        $this->session_cookie = [session()->getName() => $this->session_id];
    }
    public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
    {
        $cookies = array_merge($cookies, $this->session_cookie);
        parent::call($method, $uri, $parameters, $cookies, $files, $server, $content);
    }

but it works only for $this->get() and other like this, not for $this->json()

Agelios started a new conversation Session Id Changed

Hi. I have trouble with testing my api.

$phone = '6876876876';

        $this-> json('post', route('api.client.login'), [
            'phone' => $phone
        ]);
        
        $this->json('post', route('api.client.login.confirm'), [
            'phone' => $phone,
            'code' => '12345678',
        ])->dump();

I need same session for both requests. How i can do it?

03 May
1 year ago

Agelios left a reply on Access An Local Disk With Laravel

@Christiaan in config filesystems.php add new disk. And set your root. And then Storage::disk('youNewLocalDisc') it shoud be fine

Agelios left a reply on Access An Local Disk With Laravel

@Christiaan

put file (files) in project path and no problem

Agelios left a reply on Check Duplicate Before Inserting It

@pordonez Model::firstOrCreate(['firstAttribute' => '', ...])

if model with ALL this attrubutes exist, its will not be dublicated.

But dont be lazy and read documentation... everything is there

25 Apr
1 year ago

Agelios left a reply on Union With Pagination - Laravel 5.6

@oroalej Need full code. $first = DB::table('sometable')->select('firstcolumn', 'secondcolumn')->where('somethink', $somethink); DB::table('other_table')->select('same_column_as_first, ..)->where(cond)->union($first)->paginate();

its work fine

Agelios left a reply on Union With Pagination - Laravel 5.6

@biishmar Its because your queries have different selects. Try use ->select() same fields in both queries and run paginate. This should help

19 Jan
1 year ago

Agelios left a reply on Send Files Over Laravel API Wont Work

@bashy i solved the problem. I didnt know that response() cant show me Input::file()

17 Jan
1 year ago

Agelios left a reply on Send Files Over Laravel API Wont Work

@bashy i have same problem. And $_FILES has a file, but laravel Input::file('name') doesnt. I test with postman. url added to virifycsrftoken middleware except.

31 Jul
1 year ago

Agelios left a reply on Problem Changing Routes Returns To Login

 $this->middleware('auth');

This method redirect you if you dont auth user

24 Jul
1 year ago
22 Jul
1 year ago

Agelios left a reply on How Can I Get User Name And Password For This

Auth::user()->password (name), user()->user()->password (name)

20 Jul
1 year ago

Agelios left a reply on Custom Error Page For All Types Of Error

You can. Go to app/exceptions/handler.php. Find render method. And write if($this->isHttpException($exception)){ return response()->view('error_view'); }

Agelios left a reply on Passing Data From Model To View

Go to you browser. right click on image and look on img src. Here is "{{$post-image_url}}" '->' lost

18 Jul
1 year ago

Agelios left a reply on Multiple User Login, With Same Table But With Different Roles.

@sadhakbj its doesnt matter, because you check role for each guard separately

Agelios left a reply on MethodNotAllowedHttpException

Show form action

28 Jun
1 year ago

Agelios left a reply on Pagination

@Hawkleaf if i want to find something in my relation, i must have a collection of my model. $products=Products::all(); foreach $products and so on. But after that i cant use paginate on this.

Agelios left a reply on SMTP Mail Fail

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=app_password MAIL_ENCRYPTION=tls

I used this configurations for gmail . About app_password you can read here https://support.google.com/accounts/answer/185833?hl=en

Agelios started a new conversation Pagination

Hello. Im interesting about one question. For example i have model Products with relation (ex. languages). And i need to paginate it. If i use Products::paginate(10) i will on view use code like {{ $product->language()->find(id)->pivot->value}}. But its ugly. Does laravel have instruments for it?

Agelios left a reply on Getting Error When Social Login The Parameter App_id Is Required

Try to login in facebook with official laravel package Socialite https://github.com/laravel/socialite Socialite have good documentation

Agelios left a reply on Laravel Says An Existing Method Does Not Exist.

Because your $request doesnt have addCource. If you want to use this method you need to create model. $newModel=new Course(); and then use $newModel->addCourse();

26 Jun
1 year ago

Agelios started a new conversation Strange Url

Hello. After i login with facebook or google (socialite) i redirect to '/'. But my url become: '/#_=_'. Why?

23 Jun
1 year ago

Agelios left a reply on Permissions Question - Preventing Admin Account From Being Deleted By Other Admin Users

@morariu field in database. You can create relation in DB 'user_admin' . And set in 'user_admin' field 'admin' to 1. When you will check user, you can check if he have relation

Agelios left a reply on ErrorException Invalid Argument Supplied For Foreach()

@Lestah before use compact('posts') you need to create a var with same name: $posts=Post::all(); maybe you have syntax error

Agelios left a reply on Trying To Get Property Of Non-object

problem in index.blade.php. So your view tried to get some value which doest exist. You can try first to dump you '$result' and find which is null. Or find line with error in view and dump that. Sorry for my bad english)

22 Jun
1 year ago

Agelios left a reply on Passport With Social Login

I used official package https://github.com/laravel/socialite I saved email, name in table 'users' and created new table 'providers' which contains 'provider' (it can be google, facebook..), 'provider_id' (its id where you conected). and 'user_id'. When you connect, you check email in 'users' (firstOrCreate in ORM). So on 1 email you can have lots of providers, password i randomed that would not be possible to enter with email and pass. Maybe I did not understand the question, but i had this solution

Agelios left a reply on Migration Error

@BarthFox read the error. You have syntax troubles. Check your code in detail

Agelios left a reply on Permissions Question - Preventing Admin Account From Being Deleted By Other Admin Users

@morariu you can have line 'admin' and set it to '1' only for admins

Agelios left a reply on Permissions Question - Preventing Admin Account From Being Deleted By Other Admin Users

You can make table with "access". And bind for Admin all access ('change_tables', 'delete_manager' ..) and for manager only ('change_tables'). In gates ( https://laravel.com/docs/5.4/authorization#writing-gates ) write some code like: if user have access to 'delete_manager' - true. else 'your user havent access') Something like it :)

Agelios left a reply on Get Form Data Before Submitting Form

You can sent data to some controller. In controller flash data to some vars, and use it. Something like this :) I need your code to say more precisely

Agelios left a reply on Get Form Data Before Submitting Form

As far as i know you cant write form in form. If you have something like

<form method="">
*</form>

php closed first form and button will do nothing.

Agelios left a reply on Middleware

Try to read this. https://laravel.com/docs/5.4/authentication I saw this error once, when "php artisan .." writes on wrong site path.

Agelios left a reply on How To Redirect A Form With Post Method When Validation Fails?

I cant find where you start your update function. Probably, when you do your 'edit' function, you need to call validation there

Agelios left a reply on Middleware

You need to define you route. Write Auth::routes(); in web file or make "php artisan make:auth"