darkec

darkec

Member Since 2 Years Ago

Experience Points 480
Experience
Level
Lessons Completed 0
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.

14 Jun
5 months ago

darkec started a new conversation Does RefreshDatabase Rollback Changes After Each Test Of At The End Of All

Let's say I have simple test with 2 functions:

public function testCreateUser()
{
    User::create(['username' => 'test']); 
}

And this is where I create a user and it has id=1.

Now I want to get that user in next test function

public function testGetUser()
{
    User::find(1); 
}

Will this user be in my database or will RefreshDatabase rollback my changes after it finishes with testCreateUser() so my user won't be saved in the database?

22 Aug
1 year ago

darkec left a reply on Polymorphic Relation Returns Query Like "Is Null And Is Not Null"

The problem was with this:

$this->homeStorages->storageLoads()->toSql();

I was taking all records and relations to it, but when I do this:

$this->homeStorages->find(1)->storageLoads()->toSql();

It works just fine

21 Aug
1 year ago

darkec started a new conversation Polymorphic Relation Returns Query Like "Is Null And Is Not Null"

I created polymorphic relation and it works just fine, but when I query it I get query like this one:

select * from `storage_loads` 
where `storage_loads`.`storage_id` is null and `storage_loads`.`storage_id` is not null and `storage_loads`.`storage_type` = ?

The problem is this part

where `storage_loads`.`storage_id` is null and `storage_loads`.`storage_id` is not null 

This is my relation inside HomeStorages model

    public function storageLoads()
    {
        return $this->morphMany(env('KALA_API_RESOURCES_NAMESPACE') . 'StorageLoads\Model', 'storage');
    }

This is my query

$this->homeStorages->storageLoads()->toSql();

Why Laravel adds "is null and is not null"

07 Aug
1 year ago

darkec left a reply on Running Laravel Script Via CLI

I'm on shared hosting and can't user Redis, this is just temporary solution I want to use, simple cron job

darkec started a new conversation Running Laravel Script Via CLI

My script requires long execution, 5+ minutes. The best solution for me is to run my script via CLI, but which way is the best from Laravel's perspective.

  1. I read about Task Scheduling https://laravel.com/docs/5.4/scheduling which is a good solution since it is run via Cron Job and that is something I need. But is that script called as CLI command and does it have execution time?

  2. Second is https://laravel.com/docs/5.4/artisan#generating-commands my own command. Which is called via CLI and I can make it execute my script.

Which is better to take and keep in mind I need execution time to be almost unlimited

22 Jun
1 year ago

darkec started a new conversation Limit On The WHERE Col IN (…) Condition

When using relations in Laravel, queries are like:

SELECT * FROM table
WHERE Col IN (1,2,3,4,5...)

Did anyone encountered with the problem of it, I guess there must be a limit of ids within IN()

09 May
1 year ago

darkec left a reply on Debug = False Is Not Working

I've tried all of that :/

darkec left a reply on Debug = False Is Not Working

Still not working this is what I get

{
  "error": {
    "message": "Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ']'",
    "status_code": 500,
    "debug": {
      "line": 103,
      "file": "E:\\xampp\\htdocs\\app\\Api\\V1\\Controllers\\Messages\\MessageController.php",
      "class": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
      "trace": [
        "#0 E:\\xampp\\htdocs\\vendor\\composer\\ClassLoader.php(322): Composer\\Autoload\\includeFile('E:\\\\xampp\\\\htdocs...')",
        "#1 [internal function]: Composer\\Autoload\\ClassLoader->loadClass('App\\\\Api\\\\V1\\\\Cont...')",
        "#2 [internal function]: spl_autoload_call('App\\\\Api\\\\V1\\\\Cont...')",
      ]
    }
  }
}
08 May
1 year ago

darkec left a reply on Debug = False Is Not Working

Unfortunately not working

darkec left a reply on Debug = False Is Not Working

they are from .env config/app.php is left as it is during installation

darkec started a new conversation Debug = False Is Not Working

I set my .env as follows: APP_ENV=production APP_DEBUG=false APP_LOG_LEVEL=info

But it stills shows me debug messages and trace in API. Why is that?

05 May
1 year ago

darkec started a new conversation Logging/Debugging API

Hi

Is there any way I can log/debug my APIs to see number of queries and similar logs. I tried with debugbar and ajax but it's not working. I've tried everything I could think of or find online, nothing is working.

Does anyone has a solution?

18 May
2 years ago

darkec started a new conversation Laravel Cache Dependency

Hi In yii, we could use cache dependency. For example:

$sql = 'SELECT * FROM tbl_post LIMIT 20';
$dependency = new CDbCacheDependency('SELECT MAX(update_time) FROM tbl_post');  
$rows = Yii::app()->db->cache(1000, $dependency)->createCommand($sql)->queryAll();

And when query result be changed, the cache content will also change before expiration and then will send to output. How to do this job in the laravel? Is there any bundle for this task?

21 Apr
2 years ago

darkec left a reply on Validator::make

Such simple solution, I was trying to "use" some different Validators, all I need to do is to "use Validator" before implementation of "class"

20 Apr
2 years ago

darkec left a reply on Validator::make

This is what I get ErrorException in ApiAuthController.php line 116: Non-static method Illuminate\Validation\Factory::make() should not be called statically, assuming $this from incompatible context after Validator::make is called

darkec started a new conversation Validator::make

What Validator is used here https://laravel.com/docs/5.0/validation when Validator::make is called?