kordix

kordix

Member Since 1 Year Ago

Experience Points
14,780
Total
Experience

220 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
124
Lessons
Completed
Best Reply Awards
1
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.

Level 3
14,780 XP
Aug
18
2 months ago
Activity icon

Replied to I'm Confused About Laravel

I kind of join to the question, last times I see Laravel less and less useful and I switch to JavaScript. Former my applications were entirely made with Laravel . Now only useful things I see is autenthication and database, maybe even only authethication, baceause I can do easily an API without Laravel.

Activity icon

Started a new conversation Bad Laracats Videos Interface Next Previous Buttons

Last interface changes of laracats are not bad, bad there is perhaps terribly annoying

I click on video just to stop/continue it but it runs previous or next episode. That's because the href areas are much bigger than button indicate.

Good I just realized it, i often clicked and didn't know what is happening.

You resize next and previous areas on video cause other may get annoyed to

Aug
12
2 months ago
Activity icon

Replied to How Can I Natsort My Data?

Sorry for digging but this is the best solution: http://laravel.at.jeffsbox.eu/laravel-5-eloquent-collection-methods-sortby

 sortBy('key', SORT_NATURAL, true)

Others maybe waste time too

Aug
11
2 months ago
Activity icon

Commented on Resolving Our First Issue

I'm sorry there is indeed but 258 commits? That's a bit too hardcore. In previous series generally one commit was one episode or two

Activity icon

Commented on Resolving Our First Issue

These series is much about github but's it's shame there is no code on github like in previous serie

Activity icon

Commented on The GitHub Repository

It's shame how many started the forum series and almost no one finished and continued the series. I think it's because of too hardcore unit tests and refactorisations

Activity icon

Commented on Trending Threads With Redis

I changed that in user.php

public function getAvatarPathAttribute($avatar)
{
    // dd('storage/'.$avatar);
    return asset('storage/'.$avatar ?: 'images/avatars/default.png');
}
Activity icon

Commented on Trending Threads With Redis

Sorry it get's to public/STORAGE/avatars folder but it still doesn't work, the avatar source is in ... just look at the source http://localhost:8000/avatars/I2aZJpTRmDgMppgSxb4NWnLotmzMq39ruTmHLOVM.png

Activity icon

Commented on Trending Threads With Redis

Just downloaded the code. Avatar doesn't upload into public/images/avatars folder.

already used php artisan storage:link

Aug
09
2 months ago
Activity icon

Started a new conversation Vue Router + Single File Components And Laravel Mix

I made this tutorial: https://itsolutionstuff.com/post/laravel-vue-router-example-from-scratchexample.html

And it throws error:

Failed to mount component: template or render function not defined.

I've read that it may be about standalone vs runtime only build https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only

But I don't know if wtih Laravel mix methodology can I acces this code:

module.exports = {
  // ...
  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
    }
  }
}

Any ideas?

Aug
08
2 months ago
Activity icon

Replied to Publishing API For Non-laravel Application, Without Logging, CORS

Strange, when I do it on domain everything works, event without barryvdh package, just without anything, but it's not too good too

Activity icon

Replied to Publishing API For Non-laravel Application, Without Logging, CORS

I also added in routes/api.php

header('Access-Control-Allow-Origin:  *');
header('Access-Control-Allow-Methods:  POST, GET, OPTIONS, PUT, DELETE');
header('Access-Control-Allow-Headers:  Content-Type, X-Auth-Token, Origin, Authorization');

Maybe problem is because I run it on localhost?

Activity icon

Started a new conversation Publishing API For Non-laravel Application, Without Logging, CORS

Hey. All tutorials I see show how to deal with CORS with JWT and loggin in.

But let's say I want to just publish API for some external application.

I installed https://github.com/barryvdh/laravel-cors

Added app/http/kernel.php in $middleware

 \Barryvdh\Cors\HandleCors::class,

Added in VerifyCsrfToken.php

 protected $except = [
     'api/*'
 ];

In axios.html

 <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script type="text/javascript">
        axios.post('myapiurl', {
           apidata
        }).then((res) => console.log(res))
    </script>

Still 'has been blocked by CORS policy' error. Run axios.html by http-server

Jul
26
2 months ago
Activity icon

Commented on A User May Not Reply More Than Once Per Minute

Where the time between replies is here specified? I review all code and i can't get it

Jul
20
2 months ago
Activity icon

Replied to Laravel Episode 45 Code Doesn't Work

I think i got there just wasn't proper column in migration. But is that just an error from Jeffrey of what?

Activity icon

Started a new conversation Laravel Episode 45 Code Doesn't Work

After I donwload and run code from that point: https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/45?autoplay=true It throws error

The value for a v-bind expression cannot be empty. Found in "v-bind:initial-replies-count"

I have all migrations, run npm install and npm run dev

Jul
08
3 months ago
Activity icon

Commented on A Vue Favorite Component

I don't know hot this

protected $appends = [ 'favoritesCount']; 

works

It's just hocus-pocus.

Laravel automatically detects something because of proper name?

Jul
02
3 months ago
Activity icon

Commented on How To Construct An Activity Feed With TDD: Part 2

Could you explain me something This:

dd(User::find(1)->activity);

works

This

public function test(User $user)
    {
        dd($user);
    }

works too with proper routing. But this:

public function test(User $user)
    {
        dd($user->activity);
    }

Doesn't work at all (returns empty array)

Activity icon

Commented on The Activity Deletion Bug

When I download code from this point activities don't work at all - it shows exception ErrorException in FileViewFinder.php line 137: View [profiles.activities.created_favorite] not found. (View: [...]resources\views\profiles\show.blade.php)

There is not indeed any view called created_favorite some is freaked up with code or with me?

May
30
4 months ago
Activity icon

Started a new conversation Store Php Variables In The View

This works inside blade.php file:

<?php
$variable1 = 'value';
$variable2 = 'anothervalue'
?>

@section('content)
{{$variable1}} {{$variable2}}
@endsection

But that doesn't work:

@include('data')

@section('content)
{{$variable1}} {{$variable2}}
@endsection

Where in data.blade.php I have the mentioned variables

It may be not proper method anyway, but first I want to pass the same variables for create and edit view and I don't want to define them twice in the controller, second it's annoying to list all the variables like so:

return view('createnew2', compact('variable1','variable2','variable3')); etc.
    
May
29
4 months ago
Activity icon

Started a new conversation Handle Edititing Without Another View

I'm courious if any of you came to same problem.

Making another views for creating and editing is really annoying. You have to make all the changes twice, with just that edit view has another post route and edit field and @if's to restore old values, the rest is the same. But it's really annoying to maintain both views.

Has anyone tried some other solution? I suppose it isn't possible with php. Maybe I should make the app in JavaScript framework and then Laravel will just handle the database api and authorisation.

Then restoring all values will be handled just by javascript without @if's

Or someone has maybe better idea?

P.S Alright, I can handle it with old() helper, but i had to dig to find out that second argument can come from database

May
28
4 months ago
Activity icon

Started a new conversation Edit View Restore Input Values Without @if

Usually when we want to restore option to stored value we can do this likewise:

    @foreach($channels as $channel)
    <option value="{{$channel->name}}" @if($position->channel==$channel->name)selected @endif >{{$channel->name}}</option>
    @endforeach

But I've got some code generated by JavaScript and it's hard to maintain that methodology.

Has anyone here tried some other method?

I was thinking about restoring proper values in JavaScript. So we get the element from database and by it we set proper option and input values. I think that Vue reactivity may here come in handy.

I was just wondering if someone here tried and maybe has some tips for something like that

May
17
5 months ago
Activity icon

Replied to Serve Many Laravel Apps (virtual Hosts) On One VPS WITHOUT DOMAIN

I'm going to buy the domain, big thanks for answer

Activity icon

Started a new conversation Serve Many Laravel Apps (virtual Hosts) On One VPS WITHOUT DOMAIN

I have laravel already working on one virtual host.

But can we serve many apps on one VPS WITHOUT buying the domain, using the ip?

Like http://ip/site1 http://ip/site2

To make it more obvious it can be:

http://ip/myaliasttest should lead to <Directory /var/www/html/site1/public> and http://ip/myaliasttest2 should lead to <Directory /var/www/html/site2/public>

there should be nothing available on http://ip

May
10
5 months ago
Activity icon

Replied to Encrypted Value In .env

I didn't really mean to secure application that way, but I don't like it that anyone who uses my computer can easily get my password.

Or I would like for e.g. workmates just present my code without showing them my passwords

I'm courious nobody has the same issue?

Activity icon

Started a new conversation Encrypted Value In .env

My goal is to write encrypted password in .env file. I've searched the web and this seems to be a solution: https://packagist.org/packages/baglerit/envariable

I need to use it without crypt facade But I can't use this in database.php

$crypt = new Illuminate\Encryption\Encrypter(env('APP_KEY'));

Shows error in console when I serve the application: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

I use it just in the top of the file, maybe I do it wrong?

Of course I have the APP_KEY generated

P.S I see that something changed from version 5.0

https://laravel.com/api/5.0/Illuminate/Encryption/Encrypter.html https://laravel.com/api/5.8/Illuminate/Encryption/Encrypter.html

In 5.0 it was

void __construct(string $key)

In 5.8

void __construct(string $key, string $cipher = 'AES-128-CBC')

Seems I have to add second argument with that cipher? I try:

$crypt = new Illuminate\Encryption\Encrypter(env('APP_KEY'),'AES-128-CBC');

But it doesn't work, same exception

P.P.S I try also 'AES-256-CBC'. Something seems wrong for me - 128 is for 16 length app key and 256 for 32? As I see all APP_KEY has 51 characters, without base64: its 44. Is this something about the length of APP_KEY?

P.P.S I think it's right clue, this works:

$crypt = new Illuminate\Encryption\Encrypter('ueMLteKXbdDreBOkzUFIwyPGvSQdKvUY','AES-256-CBC');

In that sense it's not throwing exception, I just added random string, it's not my APP_KEY

So why APP_KEY has inproper length? In config.app I have 'cipher' => 'AES-256-CBC',

Mar
20
6 months ago
Activity icon

Replied to Auth Middleware Store Problem No Message

  public function __construct()
    {
        $this->middleware('auth', ['only' => ['store','update']]);
    }

public function store(){
//just typical store method like any else...
}

Maybe I should just disable (not show) possibility to store until user is logged in...

Activity icon

Started a new conversation Auth Middleware Store Problem No Message

I want only store method to be guarded by auth middleware - I want the create and index method to be publicly accessible. It quite works - redirects to login when I try to store without logging in - but after it throws "no message" error. Can't it just make the proper store, or if it isn't possible to prevent storing and go back to previous page?

Mar
04
7 months ago
Activity icon

Replied to Reaching Api After Deployment On Digital Ocean

SOLUTION I had to allow mod_rewrite

Activity icon

Replied to Reaching Api After Deployment On Digital Ocean

I have set public as document root but I still have to write index.php and api is not working

Last time i thought I have to set public/index.php instead of public, but it worked only because I had local instance running

I did it like in tutorials someone could help?

Mar
02
7 months ago
Activity icon

Replied to Fabricjs Does Not Work With Laravel

When I added defer to included scripts it works, but maybe can someone explain why it didn't work?

Activity icon

Started a new conversation Fabricjs Does Not Work With Laravel

I am talking about fabric.js library

That library works fine when i run it outside Laravel, when I include it in the view it simply does not work. That code works perfectly:

  <canvas class="" id="c2"></canvas>

<script>
var canvas = new fabric.Canvas('c2');

var triangle = new fabric.Triangle({ left:50,
  angle: 30,
  width:50,
  height:30,
  selectable:false,
  angle:40 });

canvas.add(triangle);
</script>

But if I run it inside Laravel it just doesn't work. I have indeed the canvas in the view, I load fabric.js library and that script, it even shows errors if I have any. If I don't load fabric.js it shows 'fabric undefined').

Maybe someone had the same problem with that or any other library?

P.S Now i see that if I don't include js/app.js it does work. So it is kind of "biting" with boostrap js?

Feb
15
8 months ago
Activity icon

Replied to != Or <> Does Not Work In @if

It's good the quotes made it

Feb
12
8 months ago
Activity icon

Replied to != Or <> Does Not Work In @if

I swear on God

dd($drzwi->wizjer) 

shows "S"

@if($drzwi->wizjer <> 0) Wizjer @endif

does not show anything. This works:

@if($drzwi->kontaktron == 1)Kontaktron @endif 

just I swear on God next to it in the same place same with !=

EDIT holu shit the quotes ("0") worked

Feb
11
8 months ago
Activity icon

Replied to Reaching Api After Deployment On Digital Ocean

In 000-default.conf

<VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /var/www/html/konfigurator/public

        <Directory /var/www/html/konfigurator/public>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <IfModule mod_dir.c>
            DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
        </IfModule>

</VirtualHost>

It works quite well but still I must write index.php , without it the site kind of "catches" the routing but results at not found, when I write http://myip/index.php works perfectly, but routing works like http://myip/index.php/myroute that's still ridicioulous

EDIT Alright got it /var/www/html/konfigurator/public/index.php

Activity icon

Started a new conversation != Or <> Does Not Work In @if

When I use

@if($variable <> 0)   text @endif

or

@if($variable != 0)   text @endif

In blade file it does not work , other comparisions work perfectly. You know anything about that?

Activity icon

Started a new conversation Reaching Api After Deployment On Digital Ocean

Such api route: http://localhost:8000/api/handles/KK works perfectly on local serving But after deploying the app on DigitalOcean I can't get to api in any way. I tried http:// MYIP /mysite/api/handles/KK or http://MYIP/mysite/public/api/handles/KK

(the app isn't directly in www folder but subfolder since i have many apps)

EDIT now it works after I run php artisan serve on remote server, but do I have to keep it all the time or what? Is that a proper method?

Dec
29
9 months ago
Activity icon

Replied to Dusk Does Not Work

return RemoteWebDriver::create(
            'http://localhost:8000',
            DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY,
                $options
            )
        );

I switched here to port 8000 instead 9515 now it shows error instead of failure

Tests\Browser\ExampleTest::testBasicExample
TypeError: Argument 1 passed to Facebook\WebDriver\Remote\DesiredCapabilities::__construct() must be of the type array, null given, called in C:\xampp\PROJEKTY\dupa\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php on line 127

C:\xampp\PROJEKTY\dupa\vendor\facebook\webdriver\lib\Remote\DesiredCapabilities.php:33
C:\xampp\PROJEKTY\dupa\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:127
C:\xampp\PROJEKTY\dupa\tests\DuskTestCase.php:42
C:\xampp\PROJEKTY\dupa\vendor\laravel\dusk\src\Concerns\ProvidesBrowser.php:192
C:\xampp\PROJEKTY\dupa\vendor\laravel\framework\src\Illuminate\Support\helpers.php:754
C:\xampp\PROJEKTY\dupa\vendor\laravel\dusk\src\Concerns\ProvidesBrowser.php:193
C:\xampp\PROJEKTY\dupa\vendor\laravel\dusk\src\Concerns\ProvidesBrowser.php:93
C:\xampp\PROJEKTY\dupa\vendor\laravel\dusk\src\Concerns\ProvidesBrowser.php:64
C:\xampp\PROJEKTY\dupa\tests\Browser\ExampleTest.php:21

SOLUTION You must install ChromeDriver https://sites.google.com/a/chromium.org/chromedriver/downloads

It was not so obvious in documentation, they just write something about chmods

Activity icon

Replied to Dusk Does Not Work

@SHEZ1983

public function testBasicExample()
    {
        $this->browse(function (Browser $browser) {
            $browser->visit('/')
                    ->assertSee('Laravel');
        });
    }

public function testBasicExample()
    {
        $this->browse(function (Browser $browser) {
            $browser->visit('/')
                    ->assertDontSee('Laravel');
        });
    }

Wow thanks

Activity icon

Started a new conversation Dusk Does Not Work

assertSee does not work at all - fresh Laravel Installation fresh php artisan dusk:install , big text on middle on the screen "Laravel", assertDontSee DOES work

P.S can you tell me how to show code snippets now, IMHO don't like changes on forum

Activity icon

Started a new conversation Laracasts Can't Perform Payment

I update data for my credit card it just shows Uh Oh your card does not support this type of purchase

I used payment with that credit card twice

You 've got an idea?

Dec
22
9 months ago
Activity icon

Replied to Something Like @if In Controllers

Damn that was good thanks

Activity icon

Started a new conversation Something Like @if In Controllers

Can I use something like @if but in controllers, not in the views?

Here's concept: I have a language learning program. It just asks me for words, when i answer for one word it moves to another. I have a $next variable to set the next word, it depends from a few factors. If I want to use one category, its ->where('category'=$this->currentcategory , if I want to learn sentences its ->where('sentence'=$this->sentencesetting etc.

Now what I can do is writing multiple if's for every condition. Can't I just conditionally add some piece of code?

Jul
22
1 year ago
Activity icon

Replied to Error Installing Laravel 5.6 App On Remote Hosting

I was having similiar issues, beside storage there is bootstrap folder to set chmods

Activity icon

Replied to Grouping And Searching Data

Really no one has no clue?

I was thinking it would look something like that in the view

@foreach($categories as $category)
    <b>{{$category->title}}</b><br>
    @foreach($category->subcategories as $subcategory)
        {{$subcategory->title}}
           @foreach($subcategory->jokes as $joke)
            {{$joke->title}}
            @endforeach
    @endforeach
@endforeach 

Has anyone used such a construction?

Activity icon

Replied to Create/update Sql Records Without Form

Sorry my answer was cut ('<a href' code was converted to link) , I added more description, can you have a look

Jul
21
1 year ago
Activity icon

Started a new conversation Create/update Sql Records Without Form

Can I make an update in SQL without < form >, input nor {{csrf_field}} , {{method_field('patch')}}?

I would like just to make controller which updates some record in database and execute it with < a href="{{route to that controller}}" > It may be just a button wchich executes the controller.

Now in controller I make Model::update([ 'record' => request('record') , and in the view I make a button inside form with hidden input with proper name and wanted value.

My controller would look like : Model::update(['record' => 'mywantedvalue']) , without request. Is there some way just to execute it?

Jul
17
1 year ago
Activity icon

Started a new conversation Grouping And Searching Data

I want to makes a Jokes application. Basically it's just a typical CRUD with jokes catalogue.

But I have a few slight problems.

First thing is showing all data grouped by given order. It's quite easy - i can just use orderby() on collection. But I need to make modifications in the view - precisely I want to give a header for each group.

So let's say it's like that.

NEW JOKES |vulgar jokes - politics blondes doctors policemen |decent jokes - politics blondes doctors policemen

OLD JOKES |vulgar jokes - politics blondes doctors policemen |decent jokes - politics blondes doctors policemen

With manytomany relationship I can easily define one group given by user, or just group by category. In the view it would like something like that:

@foreach($categories as $category)
    <b>{{$category->title}}</b><br>
    @foreach($category->jokes as $joke)
        {{$joke->title}}
    @endforeach
@endforeach

What I need is category + SUBcategory + SUB-SUBcategory Is there something like groupby() which gives collections array wchich I can use with @foreach in the view?

Jul
12
1 year ago
Activity icon

Started a new conversation Simple Refactor Doesn't Work

this: $next = Question::where('id', '>', $id) ->min('id'); return redirect()->route('show', ['id'=>$next]); inside a function does work

but if I want to export this to another function and it just does nothing

Following function doesn't work:

public function setCounter($id, Request $request) { Question::find($id)->update(['counter'=> request('counter')]);

    session()->flash('message', 'Ok masz rację');
   $this->nextt($id);
}

public function nextt($id) { $next = Question::where('id', '>', $id) ->min('id'); return redirect()->route('show', ['id'=>$next]); }

It just makes no redirect It's just not possible to redirect by calling another function?

Jul
08
1 year ago
Activity icon

Started a new conversation Route To Controller

In symfony I could make routing just inside the controller, just by setting the route above the controller method, I didn't have to set routes in seperate file.

But I think about slightly different thing, I want to execute the method directly in the view, something like href={{route(name)}}, but it should be something like {{controller('methodname')}}

Do I have to set every single method I use in web.php file?