tekmi

Member Since 2 Years Ago

Amstelveen

Owner at TekMi

Experience Points 110,680
Experience Level 23

4,320 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 961
Lessons
Completed
Best Reply Awards 22
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.

11 Jul
1 year ago

tekmi left a reply on Using Routing Outside Of Laravel Without The Huge Dependency List

Hi @twiggy99

Maybe what your are looking for are actually Symfony Components, especially Http Foundation and Routing.

http://symfony.com/doc/current/components/http_foundation.html http://symfony.com/doc/current/components/routing.html

If you dive deeper into the Laravel's source code, you will find that Laravel uses it under the hood.

Or you can explore other, very efficient routings library such as

https://github.com/klein/klein.php https://github.com/nikic/FastRoute https://github.com/c9s/Pux (as php extension)

There are also some posts trying to benchmarks those as others routers - feel free to explore the followings

http://radify.io/blog/routing-in-php-a-complete-benchmark/ https://github.com/tyler-sommer/php-router-benchmark

tekmi left a reply on What Is The Benefit When Using Laravelcollective From And Not Using HTML

I've struggled with the same question, so I decided to take a deeper look into this package.

I've put all my findings in here http://blog.tekmi.nl/is-it-beneficial-to-add-laravel-collective-html-package-into-your-laravel-project/

09 Jun
1 year ago

tekmi left a reply on Unable To Get Spark Notifications To Work...

@clat23 I'm glad to hear you managed it! Great job!

08 Jun
1 year ago

tekmi left a reply on The Default Remember_me Token Is Too Long

@troccoli So looks like you have solved it. Great job! :)

tekmi left a reply on Unable To Get Spark Notifications To Work...

@clat23 you are on the right track.

Have you seen those episodes about Service Container?

https://laracasts.com/series/laravel-from-scratch-2017/episodes/24 https://laracasts.com/series/laravel-from-scratch-2017/episodes/25

Those should help you understand Service Container better. When it comes to resolving classes out of Service Container, it's also nice to study this part of the Laravel docs https://laravel.com/docs/5.4/container#resolving

Check if you are already able to resolve your class with all dependencies by running

App:make('App\ResponseErrorHandler')

If not, you may need to do some adjustment in your ResponseErrorHandlerServiceProvider:

$this->app->bind('App\ResponseErrorHandler', function ($app) {
    return new ResponseErrorHandler(new NotificationRepository());
});

tekmi left a reply on How To Limit User To Edit Only Their Own Profile With Laravel ACL

Wow, that went pretty fast. I'm glad I could help :)

tekmi left a reply on How To Limit User To Edit Only Their Own Profile With Laravel ACL

Hi @Hujjat

In your UserController, try to call it like

if(!Gate::allows('isMyAccount', $user)) {

and adjust your gate definition to

$gate->define('isMyAccount', function($user, $profileUser){
    return $user->id === $profileUser->id;
});

tekmi left a reply on The Default Remember_me Token Is Too Long

@troccoli

Try to extend the SessionGuard and update the config/auth.php config accordingly.

I've found this post that may give you some inspiration: https://stackoverflow.com/questions/36087061/extending-laravel-5-2-sessionguard

Presented solution is for Laravel 5.2, but I guess it should be pretty similar in Laravel 5.4

Hope this can help.

tekmi left a reply on Forum Package For Laravel?

@ahm750

I know of https://www.phpbb.com, but never actually used it. It has been in PHP world since 2000. Current release is 3.2 as far as I know.

The another forum I know of, Laravel based, is http://flarum.org/

Jeffrey's series about building forum from scratch focus on newest Laravel 5.4 technics with TDD approach, so you won't find any base package there. He builds everything from scratch, integrating Vue.js as the javascript framework.

tekmi left a reply on Unable To Get Spark Notifications To Work...

@clat23

Your class ResponseErrorHandler expects first parameter to be of type NotificationRepository

tekmi left a reply on Editing Config App Params At Runtime

@toniwiki You could use relational database, like SQLite or try NoSQL solution like Redis key/value store - to offload your main database.

If you go this route, you would probably need to create your own SettingsManager and manage persisting/getting of your settings by yourself.

07 Jun
1 year ago

tekmi left a reply on Creating A Settings Service Provider?

In this case, I would stick to the Eloquent model and MySQL, however you could use only the DB facade too.

Will those settings be connected to other entities or those are just application settings?

tekmi left a reply on Creating A Settings Service Provider?

Dear @leecjeffries

Honestly, I would start very simple and only create the Eloquent model.

tekmi left a reply on How I Can Replace The "required" Validation From Laravel?

@pedrogaldino I'm not sure if this is possible.

Most of those Validators are actually protected methods on the trait: https://github.com/laravel/framework/blob/5.4/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L1024 which is used by the https://github.com/laravel/framework/blob/5.4/src/Illuminate/Validation/Validator.php#L20

What is the thing you want to achieve ? And why are you so reluctant to extend the Validator class ?

Best!

tekmi left a reply on HasMany On A Date Field

@matthallett Maybe you could try to define payment date accessor like getPaymentDateAttribute instead of adding payment_date to $dates array?

You could return Carbon instance from there.

tekmi left a reply on How Do I Validate All Of An Array's Elements?

Dear @tareenmj

Maybe this piece of documentation https://laravel.com/docs/5.4/validation#validating-arrays will give you some inspiration?

Best!

tekmi left a reply on Can You Hide Overflow On An <img> Tag?

Hi @TheFriendlyHacker

I'm not sure, but maybe giving your customers an option to crop the image before it gets saved, is not that bad in the end.

It's not resizing, it's giving them the way to adhere to image dimensions you expect on your website.

I was using http://scottcheng.github.io/cropit/ library and it worked pretty well for me.

Best!

tekmi left a reply on Laravel 5.4: Fetching Data From Url With No Parameter

Cool! I'm glad we could figure it out together!

The order of routes matters. They are parsed from the top to bottom of the route's file.

If some route has placeholder like user/{placeholder} and you put it first, then all the subsequent routes user/getSomething, user/getContent will be intercepted by the first one - meaning will never be reached. I think this is what happened in your case.

You can always check your routes by casting: php artisan route:list

tekmi left a reply on Laravel 5.4: Fetching Data From Url With No Parameter

@suo Or try to comment out all other routes, leaving just this one

 Route::get('user/getAssessmentPage', ['uses'=>'Users\[email protected]', 'as'=>'user.getAssessmentPage']);

If this doesn't work if you call it via AJAX, then it's magic to me :)

tekmi left a reply on Laravel 5.4: Fetching Data From Url With No Parameter

@suo Hmm, try to move the

Route::resource('user', 'Users\DashboardController')

below the Route::group. Maybe those resource route intercept the others...

tekmi left a reply on Laravel 5.4: Fetching Data From Url With No Parameter

@suo

For me it's very strange. I've never come across such constraint. But I would need to see all your routes and the views to draw any conclusion.

Which Laravel version do you use?

tekmi left a reply on Steam Auth User Not Being Created

@SomePanns Did you try to add the username to fillable fields?

tekmi left a reply on Laravel 5.4: Fetching Data From Url With No Parameter

@suo Please make sure that this Eloquent model Assessment_Page returns some records. Then you can rebuild your method to something like:

public function getAssessmentPage()
{
    return Assessment_Page::all();
}

By default, collections are casted to json, so you don't need to do it yourself.

tekmi left a reply on Laravel 5.4: Fetching Data From Url With No Parameter

@suo

Can you show me the die and dump of this

public function getAssessmentPage()
{
    $content= Assessment_Page::all();
    $response = response()->json($content);

    dd($response);
    return $response;
}

tekmi left a reply on Vagrant Xenial Box Disk Storage

@Wilby1976

When it comes to memory, I usually use this configuration:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

    config.vm.define "webserver", primary: true do |config|

        config.vm.box = "ubuntu/trusty64"

        config.vm.network "private_network", ip: "10.150.150.100"


        config.vm.provider "virtualbox" do |vbox|
            vbox.memory = 1024
            vbox.cpus = 1
        end

    end

When it comes to disk size, I've never played with this, but I've found several links that may be useful:

https://tuhrig.de/resizing-vagrant-box-disk-space/ https://medium.com/@phirschybar/resize-your-vagrant-virtualbox-disk-3c0fbc607817 https://gist.github.com/christopher-hopper/9755310

tekmi left a reply on Laravel 5.4: Fetching Data From Url With No Parameter

@suo

You didn't see anything in your Network tab of Chrome Devtools? There should be some XHR recorded.

I would also try with $.ajax() method instead of $.get(). In this way you can listen on errors too like

var jqxhr = $.ajax( "example.php" )
  .done(function() {
    alert( "success" );
  })
  .fail(function() {
    alert( "error" );
  })
  .always(function() {
    alert( "complete" );
  });

tekmi left a reply on Contacts Page Send To Pre-defined Email

Interesting. Good to know :)

tekmi left a reply on Contacts Page Send To Pre-defined Email

@Bartude

If you remove this part from your view

<p>{{$message}}</p>

will you still get an error?

tekmi left a reply on Eloquent + Oracle

No worries. Laravel has its weirderness all over the place.

Good luck with your further Oracle database journey!

tekmi left a reply on Contacts Page Send To Pre-defined Email

@Bartude

Please double check this part

return $this->from($this->email)
                    ->subject('Message Sent')
                    *->view('emails.newsletter')->with(['message' => $this->message]);*

I think you are trying to pass the message which is actually an object.

tekmi left a reply on Eloquent + Oracle

Dear @it-systemmanagement

After reading this https://laravel.com/docs/5.4/routing#route-model-binding, look like the issue may be that your {hotel_id} mismatches the value $partners

I would try to change your route to:

Route::get('/partners/{partners}', '[email protected]');

tekmi left a reply on Migration Skipping First File

@devartpro I thought you are starting your project or that you are building your testing/acceptance environment from scratch. In this case it's fairly normal to recreate the database.

In case you try to apply your migration to the existing database, then it is completely different story.

It's weird that the first migration is skipped. Looking at the timestamps of those migration files, it should be in the correct order.

And if you are saying that the migrations table is empty...then it's even more weird.

One thing that comes to my mind is that maybe you use database or database engine that does not support foreign keys...

Can you also show those migration files? Maybe there is some table names mismatch there?

tekmi left a reply on Editing Config App Params At Runtime

@toniwiki You could try to use the Config facade. This facade is actually this class https://github.com/laravel/framework/blob/5.4/src/Illuminate/Config/Repository.php, so I assume you should be able to use the set method like Config::set('')

tekmi left a reply on HasMany Relation : Retrieve Relation Items Through A Collection

@DimiFFT Please check out the eager loading part: https://laravel.com/docs/5.4/eloquent-relationships#eager-loading

You should be able to get teams with the users with something like Team::with('users')->where(.., ..)->get(). Just die and dump it to see the difference.

I assumed here that One Team has many Users and you have users table.

tekmi left a reply on ENVOYER: Is It Possible To Deploy A Repository With Submodules?

@Nikita240 Did you try to add the deployment hooks as specified in this lesson https://laracasts.com/series/envoyer/episodes/4 ?

I would add the post hook after the 'Clone New Release`.

I have never used Envoyer myself, so I hope the video is still valid and beneficial to you :)

tekmi left a reply on Laravel Auth Package Customization

Hi @lakhan.khandelwal

Have you seen this episode https://laracasts.com/series/laravel-from-scratch-2017/episodes/17 ?

Jeffrey explains there where to find the RegistrationController and where all auto-generated views after running php artisan make:auth reside.

Hope this can help.

tekmi left a reply on Is It Possible To Deploy A Repository With Submodules?

@Nikita240 Can you describe how you perform your deployment and which tools you use for that?

From my experience, tools like Envoy or Deployer, they usually delete .git folder, therefore you cannot do any other git related operation, once the application got deployed.

However there is always an option to hook into the process of deployment. So if you git clone, your main branch/tag, try immediately initialize your git submodules.

tekmi left a reply on Error - Call To A Member Function VisitedThreadCacheKey() On Null

@ashleyclamp I think you may not have any user authenticated. Please double check what auth()->user() returns. I guess it will be null.

06 Jun
1 year ago

tekmi left a reply on New Macbook 12 Inch Is Good Enough For Web Development ?

@hojjat Depends on what is your development environment and to which tools you got used to.

If you tend to develop on guest system by virtualizing other systems, like Ubuntu, check out how much memory and how many virtual CPUs your host machine can share - If you think of using Docker or Valet, this may not be an issue though.

If you want to use modern IDE, like PHPStorm, you must be aware of their minimum system requirements: https://www.jetbrains.com/help/phpstorm/system-requirements.html

If you plan to use Chrome browser, check out their requirements too https://support.google.com/chrome/a/answer/7100626?hl=en, however in this case it should never be an issue imho.

Before you buy anything, please think twice about your display size. As an example I currently use Macbook 15.4 inch and honestly without second monitor, it's hard for me to code efficiently.

When I travel, I have not choice so I use Macbook's screen only - however I constantly need to change the whole IDE settings :)

tekmi left a reply on Software Documentation Recommendations

@alexhiggins

I've used Confluence https://www.atlassian.com/software/confluence for many years and I'm still amazed how flexible and usable it is.

You can structure your documents in readable way:

  • Firstly by creating pages and subpages.
  • Secondly by using multiple headers which are used to create Table of Contents.

Additionally you can export your documents to PDF and other formats. You have the history of changes so you can see diffs or rollback to previous version. You can restrict certain documents or resources to given people. You can also store all your assets there, either images or inline pdfs.

Moreover It has lots of plugins and integrates nicely with JIRA and Bitbucket. So you can create special type of documents like checklists or roadmap documents.

I definitely recommend this piece of software.

tekmi left a reply on 'Deploy' Error

@feralheart

If you use Filezilla and copy project directory, you most probably also copy your vendor directory, where all Laravel and other dependencies reside.

Please double check if vendor directory is not empty, while you cast git clone command. It should be, therefore you usually run composer install on your deployment server/machine.

tekmi left a reply on Sub-domain And Main Domain Using Same Laravel Application

@samalapsy Honestly I'm not sure. Jeffrey is the king here, so maybe you can reach to him :)

tekmi left a reply on Laravel 5.4 - Upload Files With Axios

@tyris I think you actually may not send your images properly via Axios.

Did you try to use https://developer.mozilla.org/en-US/docs/Web/API/FormData when you build your key/values to be sent to server?

I found one example from Axios repository that may be useful: https://github.com/mzabriskie/axios/blob/master/examples/upload/index.html#L27

Or there is also some package on NPM: https://github.com/AshikNesin/axios-fileupload/blob/master/index.js

Good luck!

tekmi left a reply on Laravel 5.4, Auth::getProvider() Is Undefined

@meness That is strange, I've just tried it like this:

dd(\Auth::getProvider());

and i got this output:

EloquentUserProvider {#329 ▼
  #hasher: BcryptHasher {#331 ▶}
  #model: "App\User"
}

Maybe your problem is connected to wrong namespacing of Auth facade?

tekmi left a reply on Migration Skipping First File

Did you try to drop the database, recreate it and then again run those migrations?

tekmi left a reply on How Can Deploy Two App Demo.example.com And Example.com?

@vipin93 Maybe taking a look at this very old Laracasts' tutorial https://laracasts.com/lessons/wildcard-subdomains will give you some hints.

tekmi left a reply on Sub-domain And Main Domain Using Same Laravel Application

@samalapsy I have found this video on Laracasts https://laracasts.com/lessons/wildcard-subdomains

However keep in mind it's very very old tutorial, touching Laravel 4 if I'm not mistaken.

05 Jun
1 year ago

tekmi left a reply on ReflectionException: Class Login\Http\Kernel Does Not Exist

So looks like composer dumpautoload has helped?

tekmi left a reply on ReflectionException: Class Login\Http\Kernel Does Not Exist

I would do the following:

  • double check the composer.json file if your psr-4 autoloading configuration was updated to your new namespace
  • clear all cache php artisan cache:clear
  • run composer dumpautoload to understand the latest changes to namespaces