Pixelairport

Pixelairport

Member Since 2 Years Ago

Berlin

Experience Points 16,250
Experience Level 4

3,750 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 151
Lessons
Completed
Best Reply Awards 0
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.

13 May
2 months ago

Pixelairport left a reply on MP3 Upload

@ROBSTAR - what do you mean?

25 Mar
3 months ago

Pixelairport left a reply on Access Errors After Form Validation

Ok. Its seems its not working the way i wanted to do it. I use validation instead again. thx

Pixelairport left a reply on Access Errors After Form Validation

Thx. In the past i did it that way. But i tried to refactor it and use only

public function contact(ArtistContactRequest $request) { // ... }

in the controller and do the rest in a single file which extends FormRequest. Everything works like the other way. And the code would be cleaner. But i just dont get the messages?!

Pixelairport started a new conversation Access Errors After Form Validation

Hi. I tried it now for 2 hours and it just dont work. I use a validation like this:

public function contact(ArtistContactRequest $request) { // ... }

And it's validating. But it redirects me back to last page if validation was not true. But in the next page I want to get the errors in my controller. But how can i access them?

30 Dec
6 months ago

Pixelairport left a reply on MP3 Upload

Ok. I think i will let the users upload mp3 with their custom settings and just validate for a maximum filesize.

Pixelairport started a new conversation MP3 Upload

Hi. I think about a application like spotify. Musicians can upload songs. Do you think its enough to restrict the upload to MP3s. Or would it better to use something like transloadit to have a standard of MP3s (e.g. bitrate)? I think it is enough to upload MP3s encoded by the user. But maybe you know problems, what could be if I dont have a standard of exact same filestypes?

12 Nov
8 months ago

Pixelairport left a reply on Switch Composer Package From Vcs To Path And Back

It works :) This is how i load my package from git.

{
            "type":"package",
            "package": {
                "type": "package",
                "name": "pixelairport/platform-api2",
                "version":"1.0",
                "source": {
                    "url": "https://github.com/pixelairport/platform-api2.git",
                    "type": "git",
                    "reference":"1.0"
                },
                "autoload": {
                    "psr-4": {
                        "Pixelairport\PlatformApi2\": "src"
                    }
                }
            }
        },
```

I also set the psr-4 for my autoloader. it seems when it is not a composer package from packagist, it dont use the composer file of the package. So i do it here. Not sure if I'm wrong. I just write it if someone else have the problem. Maybe this helps...

To load a provider I had to add it in config/app.php because of the not loaded composer file. Here is the post where i read it: https://likegeeks.com/install-and-use-non-composer-laravel-packages/

Thx also @robstar for your help. Now it works like I hoped it would be.

Pixelairport left a reply on Switch Composer Package From Vcs To Path And Back

Thx @robstar did it first with path type, but now it seems i found the best solution for me:

  { "type": "git", "url": "https://github.com/pixelairport/platform-api2.git" }

This loads the package from github with .git files to push changes back. But one last thing does not work. I have this in my composer

 "extra": {
        "branch-alias": {
            "dev-master": "1.0-dev"
        },
        "laravel": {
            "providers": [
                "Pixelairport\PlatformApi2\Providers\ApiProvider"
            ]
        }
    },

But my ApiProvider is not booted or registered when load my application. Is this not possible with type git?

Pixelairport left a reply on Switch Composer Package From Vcs To Path And Back

... I use now symlinks locally to develop my packages. But what if I deploy the whole application? In production composer should use the version from vendor directory. But i wont update my composer.json everytime when i deploy my main applicaiton. Hope somebody can help me. Thx.

Pixelairport left a reply on Switch Composer Package From Vcs To Path And Back

Maybe I don't understand it right. I want to develop my own package. I also build a main application, which i will use for every other application in the future. It loads everything I use all the time. When I install it locally it should also load the dependencies from github (my own package). But when I decide to change something in the package I want to clone it into packages folder and make my changes. Then I deploy it. In this situation the package from my packages directory should be used.

Or is there a better workaround? Thx.

11 Nov
8 months ago

Pixelairport started a new conversation Switch Composer Package From Vcs To Path And Back

I still try to learn more about composer. I found out how to use "path" type to load local package with symlink in composer. When i do "vcs" type I can load the package from my github account. Now I don't understand how my composer.json should look like.

I want to switch between them, that my local packages still uses my local packages, but when I do "composer install" in production, the packages should be loaded and used in vendor. Is that possible or do I have to change the composer.json each time?

That is what I have for local package:

{
            "type": "path",
            "url": "packages/pixelairport/platform-api2",
            "options": {
                "symlink": true
            }
        }

And that is what I need for production.

        { "type": "vcs", "url": "https://github.com/pixelairport/platform-api2.git" },

How can I have both in one composer.json that the local version is maybe only used when the directory exists?

....

10 Nov
8 months ago

Pixelairport left a reply on Composer Autoload For My Own Package

Thank you @primordial I found a solution. I was really a problem with autoload files. The kind i tried to load the extension works, but it doesn't generate an entry in autoload files. For my other packages it worked. Its a special thing for Cartalyst Platform to load packages in other directories as vendor. To generate also autoload entries I had to change the composer code to ...

{ "type": "vcs", "url": "https://github.com/pixelairport/platform-api2.git" }

... like in this post: https://github.com/composer/composer/issues/6846

09 Nov
8 months ago

Pixelairport left a reply on Composer Autoload For My Own Package

I tried it but it doesn't work. Also other packages have "src/". It seems my autoload files are not updated. Also with autoload-dump -o... could it be the problem is my main composer file, because I require the package from github like this:

{
            "type":"package",
            "package": {
                "name": "pixelairport/platform-api2",
                "version":"1.0",
                "source": {
                    "url": "https://github.com/pixelairport/platform-api2.git",
                    "type": "git",
                    "reference":"1.0"
                }
            }
        },

Pixelairport left a reply on Composer Autoload For My Own Package

Just started but i set it to public to check. Thx.

=> https://github.com/Pixelairport/platform-api2

Pixelairport started a new conversation Composer Autoload For My Own Package

I spend 4 hours now and i cant fix it. I build an composer package which is loaded from github via composer require. It also loads the files, but the autoloader will not include the new path to src folder. I also did composer dump-autoload.

The package is loded into "vendor/pixelairport/platform-api2" and this is my composer.json in this package:

{ "name": "pixelairport/platform-api2", "description": "Base for APIs with Platform applications.", "type": "library", "autoload": { "classmap": [ "src/" ], "psr-4": { "Pixelairport\\PlatformApi2\\": "src/" } }, "minimum-stability": "dev", "require": {} }

Hope somebody can help. Thx.

05 Nov
8 months ago

Pixelairport left a reply on Install Path For Composer Package From Github

Thx for your fast response. I want to seperate the packages which i develop by myself. Some packages must also be in different folders. I use cartalyst platform. Its like a cms based on laravel. Yes i need to put it in different folders. It worked in the past in another projekt. But i dont know how i did it in the past... :(

Pixelairport started a new conversation Install Path For Composer Package From Github

I try to load a package from my private github account and that works. But the package is always placed in vendor folder. But i want to save it in a folder called packages. Maybe somebody knows the trick. Im almost giving up. That is what I have:

... "repositories": [ { "type":"package", "package": { "type": "git", "name": "mygitaccount/laravel-api", "version":"master", "source": { "url": "https://github.com/mygitaccount/laravel-api.git", "type": "git", "reference":"master" } } }, ... "extra": { "component": "application", "laravel": { "dont-discover": [ ] }, "installer-paths": { "packages/mygitaccount/laravel-api": "mygitaccount/laravel-api" } },

06 Oct
9 months ago

Pixelairport left a reply on Webserver Or Forge Or AWS

Ok i think i start with forge with digital ocean. I talked to a good friend yesterday evening whos job is it to know the whole stuff. Im only do design, development and marketing but never thought about hosting on a cloud server. So i will start simple. The next project could be one that must be scaled when it is getting bigger. I dont want to be on a server where the support cant help if i need to scale fast. Thats why i want to do a next step. Thx for help.

05 Oct
9 months ago

Pixelairport left a reply on Webserver Or Forge Or AWS

Ok. I will start to watch the laracast videos for forge :) Thx. Do you think it is also possible to start on my good old servers and move to forge when its getting bigger? Or will this be hard work. Is it better to start a small package on digitalocean/forge to avoid this extra work later when i need to scale? If you say "managed server" is good to start and it is not much work later to move i would go with the managed, to save time in the beginning. thx

Pixelairport started a new conversation Webserver Or Forge Or AWS

Hi. Its the first time I think about deploying in the cloud. Till now i had normal web hostings or managed server. But now I have a new project where i cannot say how many people will use it. Its a application to upload and download songs. Now i ask myself, what should i use. A managed server or should I start using AWS or Forge (with AWS for example). I never managed a server by my own. Thats why i think to use Forge. It seems it is for people like me, who dont want to mange cloud service by themselves. But do I really need cloud hosting? For example if I only have 1000-5000 Users a day, 300 Song Uploads, 10000 Plays each day... A normal webserver can handle this, right? When should i think about moving to cloud. Or should i start with cloud to avoid moving later. Is the pricing similar to webserver...? And does forge everything that i dont need to have too much knowledge with AWS? thx.

06 Sep
10 months ago

Pixelairport left a reply on 401 Even With X-CSRF-TOKEN When Consume Own API

Finally after two weeks of testing i found the solution:

First I use Cartalyst Platform, which is a framework/cms based on laravel. It is from the makers of sentinel. That means they use sentinel. And the platform cms comes with a refactored autenticate middleware which use sentinel. So it is not enough to use auth:api middleware. The user there will always be null. You have to put web before. In my case i need an api for my cms backend and also one for an iphone app. So i have to build up two route groups. With this middlewares:

  1. Middleware for iphone app: ['client'] Notice to define it in your kernel.php like this: 'client' => \Laravel\Passport\Http\Middleware\CheckClientCredentials::class,

  2. Middleware for web users with sentinel. This was my main problem. I ever only used ['auth:api'] but YOU HAVE TO USE ['web','auth:api'] because web will load sentinel, which can only be used if you call web middleware.

Hope it helps.

01 Sep
10 months ago

Pixelairport left a reply on 401 Even With X-CSRF-TOKEN When Consume Own API

Ok. I still have x-xsrf-token and x-csrf-token which is sent with every request. But i still get 401. It seems the middlerware ('client' => \Laravel\Passport\Http\Middleware\CheckClientCredentials::class) does not work. Last try to get help. If nobody can, i will build up two api's. Dont want to waste another week with this problem. Thx.

Pixelairport left a reply on Sentinel, Passport, Api Security

I also use both. For external apps I add

'client' => \Laravel\Passport\Http\Middleware\CheckClientCredentials::class,

to $routeMiddleware array in app/Http/Kernel.php and than use client instead of api or auth:api middleare. That works. But im interested in your workaround. I just cant access the api when im logged in with sentinel. Always get 401. Do you have an idea?

Pixelairport left a reply on 401 Even With X-CSRF-TOKEN When Consume Own API

Still on the same problem. I see that laravel_token is set in cooke of the request header. And the route includes the auth:api. Also also tested the client middleware (\Laravel\Passport\Http\Middleware\CheckClientCredentials). So maybe I just dont understand the workaround... client middleware is working for 3rd party apps already. Like a framework 7 app. And docu says I should use auth:api. Which isnt working. So what middleware should i use now and how can i define a middleware which can be accessed with a access token (bearer) and also with logged in users at laravel? ... Is it maybe a problem with sentinel? I use cartalyst platform which includes sentinel?

30 Aug
10 months ago

Pixelairport left a reply on 401 Even With X-CSRF-TOKEN When Consume Own API

Thx for fast response :) That would work, but then i do it with normal access tokens. I try to access the API as logged in user in laravel. If you scroll a bit down at the link there is the headline "Consuming Your API With JavaScript". Thats what i want to do. It already works with Barear and my Postman App. But it does not work with the X-CSRF-TOKEN in axios when I'm a logged in user.

Pixelairport started a new conversation 401 Even With X-CSRF-TOKEN When Consume Own API

Hi. As the headline already says I have a problem with my API. I use passport in laravel. Postman works fine. But when i consume my API in my backend with JavaScript I always get 401. I use axios. and X-Requested-With and X-CSRF-TOKEN are set. I use the middleware web (with \Laravel\Passport\Http\Middleware\CreateFreshApiToken) when calling the backend and the middleware '\Laravel\Passport\Http\Middleware\CheckClientCredentials' for the api calls. Does anybody have an idea... i sit here for the whole day and i wont work :( thx.

15 Aug
11 months ago

Pixelairport started a new conversation Passport Client Secrets Unsecure?

I started using laravel passport and connect it to my framework7 app. In the tutorials i found it is said that the route oauth/token needs the parameter client_secret. That means the client secret is set in the mobile app? Isn't it a security risk? I'm not sure, but does the secret encode/decode the password? I only want to know if it is the right way. But what would be another way?

20 Jun
1 year ago

Pixelairport left a reply on Valet: Cant Login To Phpmyadmin

thx. i will test it next time when trying Valet. After hours trying i decided to reinstall homestead. Next time it crashes i will try it again.

16 Jun
1 year ago

Pixelairport started a new conversation Valet: Cant Login To Phpmyadmin

I try to move from homestead to valet, because homestead made a lot of problems in the past. I saw it was really easy to install Valet, but now i have a problem. I download phpmyadmin linked it in valet but i cant login. I also updated the config that i also can use login without password... it still not works. What is the standard mysql user for Valet? I thought it is root/empty (no password)?

Used all combinations with admin, root, empty password or password as password, ... Hope there is one who can help :) thx

26 Jan
1 year ago

Pixelairport left a reply on Database Transactions Vs. Events

Sounds good. I will go this way. Thx.

Pixelairport started a new conversation Database Transactions Vs. Events

Hi. I have a question about saving multiple information in different database tables at once. For example i have users and when they are created they also have addresses, join a group and a lot more. So i have 5 tables, which should be updated. I have to be sure that everything is inserted. So my question is: Is database transaction the right thing to handle this? I just ask because a friend said he would do it with events and transactions is not the right thing? But i think transactions are really easy. I tested it in a clean laravel and it works good. So should i use transactions in my project or go another way? Thx.

19 Sep
1 year ago

Pixelairport started a new conversation Taxes For One Time Charge In Cashier

Hi. Does anybody ever tried to set taxes for one time charges with cashier. The method I use is "invoiceFor". The laravel documentation says I should manually specify the tax rate... but i dont find some information to do this. Hope somebody can help me.

thx Norman

27 Apr
2 years ago

Pixelairport started a new conversation Route Problem With Xio.io

After i was banned at laravel.io, because they say my question is spam :) ... here is another try at laracasts.

I have a lot of local projects and use vagrant with homestead. Local everything works fine. If i call https://projectfour.app:44300 then project four is shown. But when i call the url with ip address with xip.io every project routes into the same local project. project one, two, three,... and so on. I call https://projectfour.app.xxx.xx.xx.xx.xip.io and the wrong project is show on my iphone. Hope somebody can help. thx

05 Feb
2 years ago

Pixelairport left a reply on Validation "in" Not Working

Thx for your answer and asking me, if you could see the code for the input field... :) i forgot to set the name in the select field. Now it works.

Pixelairport started a new conversation Validation "in" Not Working

I want to validate a value with an array. The array is ...

['de','en','fr']

... and i do something like ...

'country' => "required|in:de,en,fr"

... but thats not working? Does anybody knows the syntax?

30 Jan
2 years ago

Pixelairport left a reply on Joins To Sort By A Model By Its Relation Updated_at

... current query returns my topics but not sorted by last changed article ''' return $query->join('articles','articles.topic_id','=','topics.id')->select('topics.*')->groupBy('topics.id')->orderBy('articles.updated_at'); '''

27 Jan
2 years ago

Pixelairport left a reply on How Can I Configure Email Sending?

What do you mean? You just have to put your config into config/mail.php or better in your .env file.

Pixelairport left a reply on Joins To Sort By A Model By Its Relation Updated_at

... when i do something like this i get the articles not the topics i want:

return $query->join('articles',function($join){ $join->on('topics.id','=','articles.topic_id')->orderBy('articles.updated_at','desc'); });

Pixelairport started a new conversation Joins To Sort By A Model By Its Relation Updated_at

Hi,

i have a scope in Topics Model ...

return $query->orderBy('created_at','Desc');

... which sorts the topics by creation date. Now i want to sort it by the latest article in the topics. Something like ...

return $query->with(['articles'=>function($q){return $q->orderBy('created_at');}])orderBy('created_at','Desc');

... does not sort the topics. Only the articles in the topics will be sorted. I need an option to add a function to the orderBy method? But i cant find information for that. I also tried a lot with joins but then i only get the articles aint the topics.

Hope somebody can help me.