frezno

frezno

Member Since 4 Years Ago

Munich, Germany

Experience Points 133,440
Experience Level 27

1,560 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 1218
Lessons
Completed
Best Reply Awards 38
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.

05 Feb
3 months ago

frezno left a reply on How To Display Own Category In Own Block With Laravel?

@IRANKHOSRAVI - very funny...

You are here asking for help and people are trying to help you, so no need to swear at them (snapey in this case)

30 Jan
3 months ago

frezno left a reply on Register Controller Return Back Upon Validator Fail

you don't get an error with this query, @dawgonking ?

i'd try

$pilot = Pilot::where('emp', request('emp'))
    ->orderBy('month')
    ->latest()
    ->limit(1)
    ->get();

frezno left a reply on GMAIL

did you change the 'from' address fields in config/mail.php to your data, @hjortur17

is there any error message?

did you try a different protocol (+ according port) or writing to log file?

27 Jan
3 months ago

frezno left a reply on How To Add Laravel Project On Github?

@msoft all you need to know to get started in the video. The only difference is, that meanwhile private repos are free as well on github. ie you can create a private repo, play around to get used to git and when all is working as you want it to work, you can either make it a public repo or delete the private repo and start from scratch and start as a public repo.

26 Jan
3 months ago

frezno left a reply on Route [nova.login] Not Defined.

if you are working on Windows, @yousails , take a look at your config/app.php file. Its pretty likely that at the section "providers" the entry App\Providers\NovaServiceProvider::class is missing. You have to add it manually and then you should be fine.

frezno left a reply on Adding A Raw Order By To Pivot Table

looks pretty messy to me, @timgavin

imho first of all you might add a ->toSql() at the end to see what the query looks like.

posts_homepage is not really a pivot table. If you want/need to use it just for the sorting of your result set, you might want to use mysql temporary table feature:

http://www.mysqltutorial.org/mysql-temporary-table/

sometimes it helps to write a pure sql-query in your database editor to see how it looks like when you end up with the desired result and then go for there to transfer it to Laravel.

25 Jan
3 months ago

frezno left a reply on Unable To Update From 5.5.44 To 5.6

@esorone can't believe that you are running shown composer.json file without getting an error.

Usually comments are not possible in json files and on the paths of both psr-4 entires and the post-autoload-dump you have to use double backslashes:

{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": ">=7.1.3", "fideloper/proxy": "^4.0", "laravel/framework": "5.6.*", "laravel/tinker": "~1.0" }, "require-dev": { "filp/whoops": "~2.0", "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "phpunit/phpunit": "^7.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "files": [ "app/helpers.php" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [] } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true } }

besides this, you can delete the composer.lock file and use composer install

btw, just updating the packages doesn't work as a standalone action for updating to 5.6. Quites some files in app the other directories have been changes and have to get updated as well

21 Jan
4 months ago

frezno left a reply on Artisan Commands

@CIPSAS - that's where i search already. Since i didn't understand how building the 'templates' is working, i couldn't find the responsible files(s). But meanwhile i figured ist out: it's using the stubs.

18 Jan
4 months ago

frezno started a new conversation Artisan Commands

Does anybody know where the artisan commands were created? I'd like to modify something (ie what the command is doing) and cannot find the place where the magic happens.

08 Jan
4 months ago

frezno left a reply on Get Looping Data Failed Sometimes

@kankai looking at foreach you shouldn't use the same variabels, ie change it to

foreach ($tags as $tag)

and accordingly the query, whereas the two wheres don't make any sense to me

05 Dec
5 months ago

frezno left a reply on How To Retain Cart Or Form Data On Page Refresh

@alphabay84 with session()->push('cart', $data) you create a session with the name cart and there you push in the data (array) $data

if you want to check whether the session exists:

if (session->has('cart') [ ... }


now, if the session exists you can get the data of the session and loop through it:

$cart = session()->get('cart');

foreach ($cart as $c) { ... }


does that make sense?

you always can take a look at your session directory (storage/framework/sessions) and check the session(s) as well.

frezno left a reply on Populate Select Field From Database

i don't use any package, @vlachos so i'm not sure whether that's the same approach the package guys use.

Anyways it should look somewhat like this:

Select::make('User')->options(\App\User::pluck('name', 'id')

frezno left a reply on Run Laravel Without Storage Permissions

no idea, @cds3419 IIS is not what i'm working with. But Microsoft usually has pretty informative pages about their products. But shouldn't your above mentioned IT manager be man in charge for setting up the server?

Maybe that helps as a starter:

https://support.microsoft.com/en-us/help/816117/how-to-configure-web-permissions-for-web-content-in-internet-informati

https://support.microsoft.com/en-ca/help/324068/how-to-set-iis-permissions-for-specific-objects

frezno left a reply on Run Laravel Without Storage Permissions

doesn't look right to me, since the storage directories are below the public dir and there's no access to the root - at least it shouldn't. Don't know whether IIS handles it differently but cannot believe that this is the case. That would be a security nightmare indeed.

frezno left a reply on Populate Select Field From Database

sure thing, @vlachos - you have to use pluck() for collecting the data.

frezno left a reply on Split Users And Profiles Into 2 Different Tables

i do seperate them, ie users, user_profile, user_addresses

reason is that usually there's no need for full user info but his password and maybe the email address.

As an admin or if the user logs in to his profile then all data is needed, but until then (imho in most cases) there's no need for the additional data, depending on the kind of app you're coding of course.

frezno left a reply on Run Laravel Without Storage Permissions

the storage dirs are located in the root, not the public dir

frezno left a reply on How To Retain Cart Or Form Data On Page Refresh

@alphabay84 you should read the session part in the docs to get an idea about handling them

https://laravel.com/docs/5.7/session

For storing your cart, you could do something like:

session()->push('cart', $data);

you could do a search about building a simple shopping cart which will help you with the basics or use an ecommerce package (see github)

frezno left a reply on Get Id Of Newly Created Record

as @vajid already mentioned, easiest would be:

$id = $user->id

but you could do a query as well, eg:

$id = User::orderBy('id, 'desc')->first();

or with raw SQL, using lastInsertId()

04 Dec
5 months ago

frezno left a reply on Populate Select Field From Database

i guess i found it out meanwhile

frezno left a reply on Populate Select Field From Database

No problem with 'pure' Laravel, @jlrdw just Nova seems not to like in in that case

frezno started a new conversation Populate Select Field From Database

Is it possible to get data from the dabase and poukate a select field with them?

Whatever i tried so far, it didn't work, ie i do get the data but Nova doesn't exept them, it doesn't like the format or whatever. I'm pretty clueless right now.

Just wanted to ask whether it's possible at all before posting a snippet for possible help from you guys.

27 Nov
5 months ago

frezno started a new conversation Working With Subdomain

I created a subdomain for some special behaviour of my site.

Well i thought i just have to install Laravel on that subdomain and it'll work. Nice thinking, but unfortunately it's not working.

Public dir of my basic Laravel install: /home/mydomain/public

And the public dir of the Laravel install on the subdomain: /home/mydomain/domains/subof.mydomain.tld/public

Laravel Telescope and Nova are installed on the subdomain.

Any ideas what's going wrong, since i cannot handle them error messages.

The error log shows following errors:

PHP Warning: require(/home/mydomain/domains/subof.mydomain.tld/vendor/composer/../laravel/framework/src/Illuminate/Foundation/helpers.php): failed to open stream: No such file or directory in /home/mydomain/domains/subof.mydomain.tld/vendor/composer/autoload_real.php on line 66

PHP Fatal error: require(): Failed opening required '/home/mydomain/domains/subof.mydomain.tld/vendor/composer/../laravel/framework/src/Illuminate/Foundation/helpers.php' (include_path='.:/usr/share/php') in /home/mydomain/domains/subof.mydomain.tld/vendor/composer/autoload_real.php on line 66

PHP Fatal error: Uncaught ReflectionException: Class view does not exist in /home/mydomain/domains/subof.mydomain.tld/vendor/laravel/framework/src/Illuminate/Container/Container.php:779

PHP Fatal error: Uncaught Error: Call to undefined function Moontoast\Math\bcadd() in /home/mydomain/domains/subof.mydomain.tld/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php:506

24 Nov
5 months ago

frezno left a reply on Computed Default Value For Text Field

Solved this using actions.

Maybe there will be a 'better' solution in the future

20 Nov
6 months ago

frezno left a reply on Computed Default Value For Text Field

@ejdelmonico perhaps you got me wrong or i explained it not clear enough, very likely the latter ;)

i'd like to automtically create a token when a dataset is created, like eg setting a boolean field per default to true or false. That way i don't have to care about those fields.

Displaying/showing them or not showing them afterwards, eg in the update mask etc. is not my concern

frezno started a new conversation Computed Default Value For Text Field

So what i'm trying is to add a text field with a computed value, ie one of the fields of the table contains a token. This token should be generated and then stored to the db when the new dataset is created and must not be overridden when other fields get updated (like to the nullable update on passwords).

The token is generated by using str_random() but whatever i tried so far, i can't make it to get the token string stored into the db.

Text::make('token')
    ->onlyOnDetail()
    ->updateRules('nullable')

    // and then something like that would be nice:
    ->defaultValue('token' function () {
            return str_random();
        })

Since i'm still pretty new toNova, maybe something like that exists, just i couldn't find it? Any help/idea is appreciated

05 Nov
6 months ago

frezno left a reply on Migration To Add Comment To Existing Column

@rijans

$table->tinyInteger('invoice_type')->comment = "0 > A Normal Invoice, 1 > A Recurring Invoice";
04 Nov
6 months ago
29 Jul
9 months ago

frezno left a reply on Understand Collection Results From Elequent Relationship In Blade

@Mrs_Beginner in your Posts Model, a Post belongs to one User, not many, ie as a start, change the belongsToMany to belongsTo

frezno left a reply on Notify User Of New Records Added

@jenya you want this in realtime, i guess.

Take a read of this, might help (at least to get you started): https://medium.com/@adnanxteam/how-to-use-laravel-with-socket-io-e7c7565cc19d

frezno left a reply on Extracting User Details From User_id

where do you get the Firstname from, @icelander ? your controller method might help to get an idea of what you're doing.

frezno left a reply on Laravel Query Builders : Join The Same Table Twice

´´´ $posts = DB::table('post_like') ->where(['like' => 1, 'post_like.user_id' => Auth::user()->id]) ->join('post_tag', 'post_tag.post_id', '!=', 'post_like.post_id') ->join('post_tag as pt', 'pt.tag_id', '!=', 'pt.tag_id') ->get();

´´´

frezno left a reply on Laravel Query Builders : Join The Same Table

if you join the same table twice, you have to give the table in the second join an alias table name.

24 Jul
9 months ago

frezno left a reply on Database Design For A Product With Lots Of Fields

why condensing fields and/or reducing the amount of tables, @MrChrxs ?

Yound don't get a reward by using the tiniest way of handling it. On the other hand, you know best, what products you are handling with.

But think further ahead. With the structure right now you are limited in the future. Could it be, that you have prices will change, or on a sale you might want to display the old price. There's no (additional) field for such a special. Could it be that you have the very same seat, made of crocodile and rhino leather and in colors nature, red and green? How do you want to handle that?

Restructuring the dabase later due to new, upcomming requirements is a way bigger pita than thinking a little ahead and trying to prepared to future changes/additions.

But, as said, it's just you who knows your products and know what might be comming up.

frezno left a reply on Database Design For A Product With Lots Of Fields

@MrChrxs to be flexible you really have to break a product down into multiple tabels.

product table with sku, qty, manufacturer_id, is_active

product_groups (which group a product belongs to, eg clothes, software, furniture...)

product_texts table with title, slug (seo), text

product_resources with image(fields), mimetype

product_prices with retail price, wholesale price, special prices tax, from-to date for special action

product_options (eg black, red, green, square...)

product_attributes (eg small, medium, large, 1mb, 2mb, 3mb...)

and you need the appropriate lookup tables as well

as you can see, it's pretty complex but it's worth to think about the structer upfront (as you do) since this time spent is well worth it. As some help you can take a look at the db structure of some bigger ecommerce programs for some input/ideas.

07 Jul
10 months ago

frezno left a reply on Is It A Good Way To Seperate Backend And Frontend In Laravel?

imho, yes, you should separate it

frezno left a reply on Migration Foreign

increment creates an unsigned integer primary key, which is unique by definition. So no need to flag it as unique.

in your temp schema the user column has to be unsigned integer, not integer and there as well, ditch the unique

frezno left a reply on How To Loop Through Menu Items In Main Layout

no, you don't have to create an extra route for this

frezno left a reply on Migration Foreign

without knowing your create-Schema it'll be very difficult to be of any help

10 Dec
1 year ago

frezno left a reply on Migrating From Laravel Password Encryption

@DY i don't think it'll work using the same password since it's two different ways of hashing it.

why don't you use the way you're hashing the password in your native app in Laravel as well (or vice versa)?

13 Nov
1 year ago

frezno left a reply on Database [mysqli] Is Not Recognized

my pleasure @RajanSingh but kudos rather go to @tankerkiller125 for providing the right package for you.

12 Nov
1 year ago

frezno left a reply on Want To Add Pagination To Search Product Page In Laravel

@kmj1993 Model::find() looks for an item by using the primary key. So it doesn't make that much of a sense to use find() for pagination.

You might use a where-clause for finding all products of a certain category

frezno left a reply on Database [mysqli] Is Not Recognized

@RajanSingh you can use the dev flag to override the stability for this package:

composer require shakahl/laravel-eloquent-mysqli @dev

03 Nov
1 year ago

frezno left a reply on NodeJS Npm Install Installation Error

@Rainieren you should try to install the npm modules not via PHPStorm but to close it and just use your terminal (cmd command on Windows). Sometimes there can be a conflict with some open files.

But most of the times the problem is npm itself. Usually it helps to downgrade or upgrade npm and then it'll work. npm can be a realy b*tch.

01 Nov
1 year ago

frezno left a reply on Delivery Price Solution

imho difficult to say without knowing your location and not knowing how far you want to offer delivery. My finding is that it's best to keep it as simple as possible, i.e. not to use too many different prices/price zones.

Easiest probabely is to use zones, like the city districts. You have to do a mix calculation about the delivery costs anyway.

frezno left a reply on Lots Of Error After Creating A Project In Laravel

no problems as far as i can see.