Pixelairport

Pixelairport

Member Since 3 Years Ago

Berlin

Experience Points
20,110
Total
Experience

4,890 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
171
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 5
20,110 XP
Sep
22
3 days ago
Activity icon

Awarded Best Reply on How To Valdiate The Right Way?

I just found this https://laracasts.com/series/guest-spotlight/episodes/11 ... I will test it . I think this is what I was looking for.

Activity icon

Replied to How To Valdiate The Right Way?

I just found this https://laracasts.com/series/guest-spotlight/episodes/11 ... I will test it . I think this is what I was looking for.

Activity icon

Started a new Conversation How To Valdiate The Right Way?

I used to use Cartalyst Platform (Laravel Components), which has a validation trait used in the repositories. Now i switched to laravel and read that I dont should use validation in repositories. I also have to find another way to validate forms and user inputs. I did a FormRequest file and load it as closure in my controller. But I dont like that it throws the error. I want to handle the error by my own. If I have errors I want to redirect the user or maybe track the times he did mistakes. So I think about to create a service, that I have the controller (gets the request), which calls the service (which checks the request), which calls the repository (which does database stuff when rest is ok). Is that the right way for me? When I understand all right, I cant use this Form Requests. I just create the Service File, which has a function (e.g. "CreatePost"), which checks everything. Is that right?

Sep
13
1 week ago
Activity icon

Started a new Conversation Socialite Security Problems

Maybe I'm to scared of doing something wrong in my system. But I started with socialite and now i created a database, which connects the social login providers and provider ids to the user. Now I ask myself, if it is a normal workaround to connect multiple social accounts to one user. For example a user can login with github and facebook. And what about security. For example a user created an account with his email address. Now he is logged out and clicks login with facebook. Should i take the facebook email and look if there is a user in database with the email and connect this? Im not sure if this could end in security problems. How do you solve this? Hope someone has an idea.

Sep
12
1 week ago
Activity icon

Started a new Conversation How To Store User In Laravel After Socialite Login

I started with Laravel 8 and Socialite. It works and i also get my data with the callback. I have one question... Do I have to implement the rest by myself. I mean that the user is stored to database? I started to create a package for this, but did I miss something? Or does socialite not have the opportunity to do this? I mean when I have laravel and the user could login with facebook for example, he also did things on my system and i need the user and user id. Thats why I also need a user, didn't I? In the package i start creating there is a database with "user_id", "provider", "provider_user_id", which will be cecked after oauth login. If there is no user, a new one is created. Would this be right?

Aug
28
4 weeks ago
Activity icon

Replied to Workaround Vue Login Into Laravel Backend

Ok. I hope I did it right... My Vue/Nuxt App redirects to my Laravel app after click on button "Login with twitch". Then user is redirected to twitch and log in. After login user is redirected to nuxt app (i had to setup the callback urls). Then in my nuxt app I have a code and state which I can use to login the user via api at my backend. Hope this is right and secure?

Activity icon

Started a new Conversation Workaround Vue Login Into Laravel Backend

Ok. I have some similar questions here on laracasts, and everything is solved now. But now I'm not sure if this is the right way. I just want to login with a mobile vue app into my backend. Users only can login with their twitch account. In the past i did the login only with laravel, which works already. Now i use vue with nuxt and already have a working login into twitch. I got an access_token back. But when i understand this right, i need an access token from my app. I did the login direct from app to twitch. Is this correct? I mean should i redirect the user to may backend and then to twitch after click the button in my app? But then the user is redirected to my backend url. If not there is a warning at twitch that it is insecure from now, because the callback url is another url... Im just confused which is the right way to do the login... I would say the best thing would be, that i dont leave the app (frontend) to redirect to backend and then to twitch. I would prefer to do it direct from app to twitch. Like it works now. But now i only have the access token. But i also need to login into my bakcend. I want to do it via api. So i need the code and state to do it via api...

Or is there a way to redirect back from the backend to the mobile app? I have no idea how. How can i redirect from an url direct into a mobile app? Would this be the right way?

Aug
25
1 month ago
Activity icon

Awarded Best Reply on Understanding Twitch Login With Vue And Laravel

Ok. I did another post in nuxt forum. I think it is better to ask there. https://forum.vuejs.org/t/strategy-problem-with-nuxt-auth-and-twitch/102254

Activity icon

Replied to Understanding Twitch Login With Vue And Laravel

Ok. I did another post in nuxt forum. I think it is better to ask there. https://forum.vuejs.org/t/strategy-problem-with-nuxt-auth-and-twitch/102254

Activity icon

Replied to Understanding Twitch Login With Vue And Laravel

I have now a nuxt app with a login button. This button redirects to my backendservice, which redirects to twitch and back and then again redirects to my nuxt app. But it seems too much redirects for me... Or is that a possible way? Im logged in. But is that also working when i have a mobile app compiled from my nuxt... Can I say: "Redirect to app instead of an url? Or is the mobile app open an browser in an overlay which can be closed after registering?"

Activity icon

Started a new Conversation Understanding Twitch Login With Vue And Laravel

As my title says i build an app with laravel for backend and a vue app (frontend). The user should login with his twitch account. But I ask myself, what is the right workaround. I use cartalyst platform (laravel packages), which include a simple one-click solution to login with twitch on a laravel page. Does the user now have to login with the Vue App and then i create the User in the laravel backend via API? The Vue App should be compiled to a mobile app in the end.

I started now with nuxt and nuxt auth. But is it right to do the login with vue and twitch and then check via api if user exists in backend, and if not create the user.

Or should I do something else? I also have to use passport. But this is only to read something like, how many users are in the app or show latest streams and so on... I mean things which are not directly connected to the user and should be public. The user things must have an login... and im just not sure... should i login like i said or should i login against my backend and the backend redirects the user or does the rest? Im so confused and dont want to start in a wrong way.

Jul
19
2 months ago
Activity icon

Replied to How To Host Microservices

Ok. I watched an online course now for lumen. Now i know how microservice will act together. Last question is how to host the stuff. I think i will test AWS. Im just scared everytime, because I dont know what it will cost in the end. But i think it is the best solution and I just have to test it.

Activity icon

Started a new Conversation How To Host Microservices

Hi. I used Laravel and Cartalyst Platform for a few years. I have an idea for a service, which has a lot of traffic and data if it will work. Till now my applications are small ones. This is why I think about do microservices and use lumen. Or is it wrong to do it that way? If it works I have millions of users, which play a game and collect points. All points are collected and not merged to show statistics for every user (Monday: 400 Points, Tuesday: 240 Points, ...).

I decided to ask here, before I start and someone will tell me in a few weeks that I was wrong. I just want to know if I'm on the right way. Is lumen good for this? I plan to have a main service, where users can login (gateway) and a score service, where the points are collected. Where can I host this when I'm finished? Can I start with a normal Webhosting Provider? I need the simplest and most fast way. I'm a person, who uses other services instead of building things like Algolia (Databases) or Pusher (Sockets). I saw there is a tool called Vapor at laravel, but it seems it is not for Lumen. Just for Laravel. My main problem is, that I want to be flexible if it will scale fast. It is also important that the database can scale. If i really have million users one day and every user has multiple point he is getting every day, there will be millions of database entries every day. I have to ask because I never had a project like that.

Hope you can give me some help. Thx.

Jul
02
2 months ago
Activity icon

Replied to LoginAs With Dusk And Cartalyst (_dusk/login/1 Is Empty)

Ok. I found out a little bit more. When i put dd('hello') into the login function in my UserController i see the hello when i visit the url in chrome, but i did not see it when i use php artisan dusk. This shows me:

Jul
01
2 months ago
Activity icon

Started a new Conversation LoginAs With Dusk And Cartalyst (_dusk/login/1 Is Empty)

Hi. I want to use the $browser->loginAs method, but I use Cartalyst Platform. When I call 'https://myurl.test/_dusk/login/1' in my browser, I got an empty page... is that normal? Also testing does not work.

When I do:

$browser->loginAs(1)->assertAuthenticated();

I got an error: The user is not authenticated. Failed asserting that a NULL is not empty.

I uploaded the code at: https://github.com/Pixelairport/platform-dusk Maybe someone of you also use Cartalyst Platform or can help me. But I think the main problem is that the page is empty when I call _dusk/login/1. Thx

Jun
28
2 months ago
Activity icon

Replied to Using ActingAs() Method With Sentinel

did you find a solution? i have the same problem because i want to write a test as sentinel user and want to use actingAs().

Activity icon

Awarded Best Reply on Get Route In Feature Test

Ok. It works now... there was a bug in an extension i use, which scaffold extensions... it was fixed... Now everything works like expected.

Activity icon

Replied to Get Route In Feature Test

Ok. It works now... there was a bug in an extension i use, which scaffold extensions... it was fixed... Now everything works like expected.

Jun
26
2 months ago
Activity icon

Replied to Get Route In Feature Test

Ok. I'm on the right way. I thought it should work, but it did not. I got:

  at vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:420
    416|         if (! is_null($route = $this->routes->getByName($name))) {
    417|             return $this->toRoute($route, $parameters, $absolute);
    418|         }
    419| 
  > 420|         throw new RouteNotFoundException("Route [{$name}] not defined.");
    421|     }
    422| 
    423|     /**
    424|      * Get the URL for a given route instance.

      +1 vendor frames 
  2   tests/Feature/CheckPagesTest.php:17

I created a really simple route now (the route name exist), without any special chars or grouping it. Really simple... and there is still the same problem. I can use $this->get('en/imprint'); but cant use $this->get(route('en.page.imprint'));

Activity icon

Started a new Conversation Get Route In Feature Test

I started with testing and found a lot of examples with:

$response = $this->get('/');

But is it also possible to do something like this:

$response = $this->route('page.en.cart');

or

$response = $this->get(route('page.en.cart'));

Because nothing works... Maybe it is a bad idea, but I'm a testing beginner, and this would sound better than use path/url for me. Am I wrong?

Jun
23
3 months ago
Activity icon

Replied to Laravel 7 Testing With Codeception Or PHPUnit/Dusk

Ok. Thx. ... I will test phpunit/dusk in laravel today.

Activity icon

Started a new Conversation Laravel 7 Testing With Codeception Or PHPUnit/Dusk

Hi. Laravel 7 has Dusk, PHPUnit, and a lot for testing applications. I want to beginn with testing... just to understand... do i still need codeception or is laravavel already have everything out of the box. I want to have the easiest way to start...

Jun
16
3 months ago
Activity icon

Started a new Conversation Do I Use The Right Middleware

Hi. I just want to ask, that I can be sure to be secure. I build a nuxt app with nuxt auth and axios. I also use passport and laravel. I found out how to connect everything and login/autorize the app. I ask myself, why there were so many websites, which said I should use middleware 'auth:api' to secure my api. Because this doesn't work. I now use client after i did this in kernel.php:

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

I just want to ask, if this is right... I hope so, because the whole process took me almost 2 full days... :/

Activity icon

Awarded Best Reply on Passport/Nuxt: Help Me To Understand The Connection With PKCE

Now it works. Sorry... I have done it like the documentation said. And i created a value in the table oauth_clients. But I thought the whole time, that the user_id in this table is for a single user. But it seems it is the user, who created this secret. I missunderstand this. So I can go on and use this secret and id for every single user. The field user_id in the other tables for access tokens are the users who are using the token... it is a bit hard, when you try to understand the whole process the first time... but it seems it works. thx

Activity icon

Replied to Passport/Nuxt: Help Me To Understand The Connection With PKCE

Now it works. Sorry... I have done it like the documentation said. And i created a value in the table oauth_clients. But I thought the whole time, that the user_id in this table is for a single user. But it seems it is the user, who created this secret. I missunderstand this. So I can go on and use this secret and id for every single user. The field user_id in the other tables for access tokens are the users who are using the token... it is a bit hard, when you try to understand the whole process the first time... but it seems it works. thx

Activity icon

Replied to Passport/Nuxt: Help Me To Understand The Connection With PKCE

Ok also this site says (https://auth0.com/docs/api-auth/which-oauth-flow-to-use) i have to choose PKCE. That means I think it is ok to redirect user to another page and do the login there instead of sending the credentials from the page. But then there is still question nr 2. When I create a client id there is also set the user id in the database of laravel. This also gives me the id (client id) and secret, which I should use in the native app. But how can the native app know about the client id and secret, when the user is not logged in? ... Sorry. I just dont understand how this should work... i know it will... but i dont understand it.

Jun
15
3 months ago
Activity icon

Started a new Conversation Passport/Nuxt: Help Me To Understand The Connection With PKCE

Hi. I had a similar thread, where I got a helpful link https://oauth2.thephpleague.com/authorization-server/which-grant/ where I found out that I have to use PKCE to login users. I build a Nuxt App (which will be compiled later to mobile app) and a Larave backend. I have two problems I dont understand.

  1. Is that a normal way that the user is redirected out of the app to a homepage of the backend to login? I think i saw this at google apps. But there are also other apps, where i type in user and password into the app and send the credentials away and get response. Or is this a bit insecure?

  2. I use nuxt auth to login users. And when i use it with passport (pkce) I should send also cliend id and client secret. But I dont understand this... because I develope the app and host it. So how can i know, before user is logged in, the client id of this user? Hopy you know what i mean. In the nuxt.config.js I have to place this:

auth: {
    strategies: {
      'laravel.passport': {
        url: 'https://streamtools.test',
        client_id: '4',
        client_secret: 'kdjenJehd83ndnvbdHGDJhfkseu32hX'
      },
    },
    redirect: {
      callback: '/callback'
    }
  },

But then it is client id 4 ... what if another user login? Do I maybe just need another grant token system as PKCE? I used the Password Grant token before, but read that this is maybe a bit insecure... Sorry. This problem took me a few days now... Hope somebody can help.

Jun
14
3 months ago
Activity icon

Replied to Trying To Understand Passport For Nuxt App

Thx... and the link is very helpful. Showed me in 20 Seconds, what i could not find in one hour on laravel page and google. :)

Activity icon

Started a new Conversation Trying To Understand Passport For Nuxt App

I build a nuxt app and backend is made with laravel. I already tested a bit and conntecte the app with Laravel Password Grant Client. But is this maybe insecure? I have to send a secret with the browser and all have the same secret, because there is only one. Would it be better to user oauth2? I mean I found this video: https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13 ... would this be the better soltion... I just dont really understand what I need... which Token ... Implicit Grant Tokens, Client Credentials Grant Tokens or Password Grant Tokens. I think Password Grant Tokens is not secure. When I understand right then Implicit Grand token give me the access hash even if im not logged in. And the Client Credentials Grand Token (like in the Video) checks if im logged in and then give me the secret to use the api...? Is that right? I would use this third option and would send the user from my app to laravel and if he is logged in i would automatically send im to the callback url with access token. Sorry... it is so much information and for me all sounds almost similar ... i need a point to start from. thx

PS: I want to crate a mobile app later from my nuxt app. So the token process should also accept username and password from the app and autologin the user... Is that the right way? In short: it should be like facebook mobile app. You can login and get data from the api.

Jun
10
3 months ago
Activity icon

Awarded Best Reply on Vapor, Firebase, Microservice, ...? What To User For Big App.

Ok. I just read a blog article for vapor. I think i will chech this.

Activity icon

Replied to Vapor, Firebase, Microservice, ...? What To User For Big App.

Ok. I just read a blog article for vapor. I think i will chech this.

Activity icon

Started a new Conversation Vapor, Firebase, Microservice, ...? What To User For Big App.

Hi. I use laravel for my applications and normally my apps are not so big. I'm planning now a new app. If it works i will got very much user, with every customer. So if a customer comes to my app he brings for example 50k-1m users. Now I think about how to build my app.

It will be a mobile app build with nuxt. My normal way would be to build a backend with laravel. But is this stable for so much users? Can I scale it? I saw that there is a new service called vapor. Or should i do something like firebase. It seems that firebase are multiple microservices, if Im right?! ...

Sorry. Till now I just used my hosting like in 1999 :P ... sometimes i use s3. What would you say is the best. I would prefer to go with laravel, because I know the system. Last thing: I'm more a growth hacker. That means I build it and if it works i go and find other people who will help me. So i use a lot of services like algolia instead of elastic search, pusher instead of build my own socket system, ... so I just want to be sure, that im not developing something, which cant be used later if it works.

hope somebody can help and know what i mean :) thx.

May
29
3 months ago
Activity icon

Replied to Work With Homestead, Sanctum SPA And Laravel

Thx :) ... 1 hour ago i implemented passport, which works great. :) i think i will wait a few month till sanctum really works.

May
26
3 months ago
Activity icon

Awarded Best Reply on Work With Homestead, Sanctum SPA And Laravel

ok... i go on with passport instead of sanctum. so this thread can be closed.

Activity icon

Replied to Work With Homestead, Sanctum SPA And Laravel

ok... i go on with passport instead of sanctum. so this thread can be closed.

Activity icon

Replied to Work With Homestead, Sanctum SPA And Laravel

Ok. I have found the first problem. I setup now the domain in /etc/hosts for domain ui.myapp.test which has 127.0.0.1. This is for the frontend nuxt app. For my backend i setup everything in homestead.yaml and the domain is myapp.test.

Now i have a problem that i got an error 419 with the message "CSRF token mismatch". I try to find where to place the csrf token i got with:

this.$axios.$get('/sanctum/csrf-cookie').then(response => {
          this.$axios.$post('/login', {
            email: '[email protected]',
            password: 'blabla'
          })
          

        });
Activity icon

Started a new Conversation Work With Homestead, Sanctum SPA And Laravel

Hi. I try out Sanctum. As I understand, when I logged in in laravel, I can also access the API routes with another SPA. The documentation says, that the domain should be the same.

Now I ask myself how I should setup everything. I have my homestead, where I do all laravel things. The domains are always something like myapp.test. And then I have also my nuxt app, which I run without homestead and only do npm run dev. This runs on localhost:3000. What is the best way to bring them together?

btw: Did they really mean, that only domains must be the same? I can host the SPA on another server as the laravel backend? The only thing is that the domain/subdomain should be the same?

May
11
4 months ago
Activity icon

Replied to Wrong Route When Using Partials

sorry... :) yes i forgot that... thx.

Activity icon

Started a new Conversation Wrong Route When Using Partials

Hi. I have a bug and dont know why, because this never happend in the past. I work with laravel, blade and have some paritals. I mean i include things with @include('partials/breadcrumb/main'). But when I do it this time i got a wrong route. This is the code:

<nav aria-label="breadcrumb" role="navigation">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="/">Startseite</a></li>
    <li class="breadcrumb-item"><a href="{{ route('user.profile.show.categories') }}">Categories</a></li>
    <li class="breadcrumb-item active" aria-current="page">Test</li>
  </ol>
</nav>

Normally I would expect the right route for "Categories" when I include it. But I got this:

https://myproject.test/users/%7B%7B%20route('user.profile.show.categories')%20%7D%7D

But when I copy the code and paste it directly into my parent blade, which included the breadcrum before and replace the @include, then it works and I get

https://myproject.test/p/cat/index

Mar
27
5 months ago
Activity icon

Awarded Best Reply on Get Text From A Single Blade File To Count Chars

Ok. Found a solution. Maybe it is a bad solution, but i think this is a good solution for me. I can choose between put the text in a textarea or build everything in phpStorm and use a blade file. For everybody, who also want to do this and want to have best seo settings with scheme. You can render sections with this function: renderSections():

$text = strip_tags(view($post->template_file, compact('post'))->renderSections()['page']);

Here i get only the section called page and can count the words and put the whole text also in the scheme json.

Activity icon

Replied to Get Text From A Single Blade File To Count Chars

Ok. Found a solution. Maybe it is a bad solution, but i think this is a good solution for me. I can choose between put the text in a textarea or build everything in phpStorm and use a blade file. For everybody, who also want to do this and want to have best seo settings with scheme. You can render sections with this function: renderSections():

$text = strip_tags(view($post->template_file, compact('post'))->renderSections()['page']);

Here i get only the section called page and can count the words and put the whole text also in the scheme json.

Mar
25
6 months ago
Activity icon

Replied to Get Text From A Single Blade File To Count Chars

I can restyle everything. This is my blade file:

@extends('layouts/default')

{{-- Page title --}}
@section('title')
    {{{ $post->meta_title }}}
@stop

{{-- Meta description --}}
@section('meta-description')
    {{{ $post->meta_desc }}}
@stop

{{-- Page content --}}
@section('page')

        <div class="section-top section-blog">
            <div class="container">
                <div class="row">
                    <div class="col-8 blog">


                        <p>Hello World</p>

                    </div>
                </div>
            </div>
        </div>

@stop

What i want is that i only get "Hello World" and when count the words I want to get 2. But now when i use the view->render method i get the whole page. With header (including navigation) and footer (with links)... so i get more than i want. For seo i need just the text from the single blade file.

Ok I will think about tomorrow about it. Maybe its a bad workaround. But i still think this is good. Because i like to use phpStorm to create my files instead of using a textarea. It seems I'm more flexible with blade files. Because i can have customized widgets and teasers in the second column... ok ... i first have to sleep... I need a break from thinking about it :) Sometimes it helps

Activity icon

Replied to Get Text From A Single Blade File To Count Chars

Yes. I try it. I build a blog system with laravel. In my backend I can choose, if i use a textarea to type in content, or use a blade file. That means I upload a blade file with the complete content. For scheme.org I want to create the json with the text, how long the text is and all other things. So I need just from this blade file the text, to use it in the json. Otherwise I have to copy the text an place it also in a field. But this would be a task I try to avoid. The blade file is rendered in the controller (with navigation, footer, ...) when I visit the blog post, but before that, I want to build the json with all the information about the blog post. Like described here https://schema.org/BlogPosting

Activity icon

Replied to Get Text From A Single Blade File To Count Chars

Sorry. I mean words. I use str_word_count() method for this. And i only want the words which are the blog article and not things in the navigation like "my account", "blog", "contact", .... I want to have the text for the articleBody and for wordCount. Never worked with scheme.org before, but i think i should do it, when i start my new blog for best seo results.

Activity icon

Started a new Conversation Get Text From A Single Blade File To Count Chars

As the headline says, i have a blade file and i want to count the chars in it. What I have is...

strip_tags(view($post->template_file, compact('post'))->render());

... which returns the full text. My problem is, that it also includes navigation, footer and all other stuff. The file has a blog post and i want to extract it to count chars and build things for scheme.org. Is there a function for this?

Activity icon

Replied to Change Request Via Trait In Model

That is why i want to delete it from request with a trait. But before delete it, I want to upload the image.

Mar
24
6 months ago
Activity icon

Started a new Conversation Change Request Via Trait In Model

Hi. I i build an extension to upload images, to use it in different other extensions. I think about using a trait which uses the boot methods to do all upload stuff and then replace the request. This is the problem... how can i replace the request. In my example i have an image called "main_image" and want to do something like that:

trait UploadTrait {

public static function bootUploadTrait()
{
    
    static::updating(function ($model) {

        request()->replace(request()->except('main_image'));
       
    });

Is that possible? Because i still get my error: Column not found: 1054 Unknown column 'main_image' in 'field list'

Hope someone can help me or have another idea.

thx Norman