Dalma

Dalma

Member Since 2 Years Ago

Vancouver

Experience Points
25,240
Total
Experience

4,760 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
131
Lessons
Completed
Best Reply Awards
12
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 6
25,240 XP
Dec
09
1 week ago
Activity icon

Replied to The Php Artisan Is Super Slow In Just One Projects

Are all of your projects running on the same system, talking to the same database, using the same php instance?

Activity icon

Replied to For Loop And Modal

Your script is built after the for each loop runs so the value in your variables that are used in creating the script is from the last record.

Render your code and then pull up the resultant html and java code it will be apparent then.

Dec
06
1 week ago
Activity icon

Replied to Advice Please

Hi James could you provide a detailed example of what you are trying to accomplish? Are only the field labels variable or are you varying the number of fields and/or purpose/data type in these fields?

Activity icon

Replied to Generate Pages Dynamically

If you know ahead of time that you will have lets say 20 forms you could have a base form and then based on some logic include one of the 20 unique forms as an include.

The format of the include statement is similar to

@include('admin.projects.formblock1',['table' => $project, 'key' => 'project'])

or

@include('admin.projects.formblock2',['table' => $project, 'key' => 'project'])


Activity icon

Replied to Generate Pages Dynamically

Do you have a fixed number of forms (18, 30, 40 etc) such that you could build the blade html for each individually or are you building a system where users can create new forms and somehow layout the fields and field positioning?

Activity icon

Replied to Calculating Retirement Date

I use the standard calculation of dead + 7 days.

Nov
29
2 weeks ago
Activity icon

Started a new Conversation Adldad2-laravel On Development PC

Hi smart people, I'm working on ldap authentication using the Adldap2-laravel package. I currently have the package installed and working correctly on my testing server but I'm having trouble getting the code with the same configuration values working on my WindowZ10 PC.

The Ldap server that I'm connecting to is running on MS Azure.

I'm running into Can't contact LDAP server error messages.

Thinking that perhaps it was a AV, Firewall or Azure issue I found and can run a simple windows ldap client on my PC that when using the account, domain and password from my .env file works.

I have fought with this for several days. The only significant differences between my development and test server is

development WindowZ10 APP_URL=http://localhost:8000

test Ubuntu APP_URL=https://real_public_domain_name.com (url changed for security purposes)

Could it be a http vs https or the fact that my development PC does not have a real DNS name?

Ideas?

Nov
27
2 weeks ago
Activity icon

Replied to Loop Not Working

Your variable $time will be an object. If you do a

dd($time); 

You should see that it's an object rather than just a field and as you are using it as your key in your array this is not a happy happy moment.

Nov
25
3 weeks ago
Activity icon

Replied to Laravel Blade View

I just found the following that may help:


-3

Nested tables need to actually be nested within <td> elements which in turn are nested within <tr>'s and other tables, not just within the tables or rows directly.

MDN Reference

<table> Permitted Content:

an optional <caption> element,
zero or more <colgroup> elements,
an optional <thead> element,
either one of the following:
zero or more <tbody> elements
one or more <tr> elements
an optional <tfoot> element
<tr> Permitted Content:

Zero or more <td> and/or <th> elements; script-supporting elements (<script> and <template>) are also allowed
<td> Permitted Content:

Flow content. (<table> is included in this list)

Activity icon

Replied to Laravel Blade View

I don't know if the markup supports a table within a table. Can you try to comment out the inside table to see what generates?

Try commenting out or removing the following

            @if ($student['subjects'])
                <table class="table table-sm table-dark collapse row{{ $student['id'] }}">
                    <thead>
                        <tr>
                            <th scope="col">subject.Id</th>
                             ..............
                        </tr>
                    </thead>
                    <tbody>
                    @foreach($student['subjects'] as $subject)
                        <tr>
                            <td>{{$subject['id']}}</td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            @endif
Activity icon

Awarded Best Reply on Adldap2-laravel Sync_attributes

Well...... if you actually upload your changed code to the server that you are testing on it works...

Sorry people, stupid programmer tricks...

Activity icon

Replied to Adldap2-laravel Sync_attributes

Well...... if you actually upload your changed code to the server that you are testing on it works...

Sorry people, stupid programmer tricks...

Activity icon

Started a new Conversation Adldap2-laravel Sync_attributes

Hi does anyone have experience with Ldap synchronization and specifically the Adldap2-laravel package? I now have the ldap login working correctly and it synchronizes the user name and password correctly from ldap back to the user model.

I have several other fields in the user model that I would like updated as well and I read that in the ldap_auth.php file in the sync_attributes method that you can either list a series of key pairs to update or can list a handler class.

I have set up:

    'sync_attributes' => [


        App\Handlers\LdapAttributeHandler::class,

    ],

but my logic in the handler class never runs.

Any ideas?

Nov
18
4 weeks ago
Activity icon

Replied to Where Updated_at Buggy?

I think that you have a timezone issue at play here.

Nov
12
1 month ago
Activity icon

Replied to Eloquent Query Relations

I'm not sure what your { and } are doing to your query?

"%{$keyword}%"

my code uses

"%$keyword%"
Nov
07
1 month ago
Activity icon

Replied to Route List Not The Same As Web.php

I once had a similar issue but I found that I had syntax error in my web.php file.

Nov
01
1 month ago
Activity icon

Replied to Model With Many Attributes: One Or Multiple Models?

I would personally create 4 models.

  • Article
  • News
  • Sports
  • Food

Article would have all of the common data and they for the unique attributes the other three models would be used.

Oct
31
1 month ago
Activity icon

Replied to Repeatably Accessing Attribute From Blade Resulting In Additional Database Queries

I'm assuming that your flight model already has an eloquent relation called 'aircraft', if this is true then yes.

Activity icon

Replied to Repeatably Accessing Attribute From Blade Resulting In Additional Database Queries

Sorry this logic would go in your controller and not in the model. I was trying to guess the controller logic that you may be using.

Activity icon

Replied to Repeatably Accessing Attribute From Blade Resulting In Additional Database Queries

In the typical N+1 discussion its expected that you add the 'with' clause to your main query.

Example something like:

Flights = 'App\Flight'::where('criteria', '=', x)
                -> with(['aircraft' => function($query){ $query->where('arrival_time',null);}])->get();

I may have some misplaced punctuation here.

Activity icon

Replied to Repeatably Accessing Attribute From Blade Resulting In Additional Database Queries

I suspect that it is and therefor you hitting the N+1 senario. For a moment change your code to return a hard coded or DB table value to see if the DB reads go away.

Oct
30
1 month ago
Activity icon

Replied to Database Table Size

FYI

MySQL has hard limit of 4096 columns per table

Oct
28
1 month ago
Activity icon

Replied to [L5] Create 3 Columns For Cards Using Bootstrap Row Class

Can you try?

@extends('layout.app')

@section('content')

<div class="row">

        <div class="col-12 text-center">
            <h2> Page caption</h2>
        </div>
</div


<div class ="row">

        <div class="col-sm-6 col-md-4">
            <div class="card border-white">
                <div class="card-header">Heading 1</div>
                    <div class="card-body">
                        <p class="card-text">Some quick example text to build on the card 
                        title and make up the bulk of the card's content.</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-sm-6 col-md-4">
            <div class="card border-white">
                <div class="card-header">Heading 2</div>
                    <div class="card-body">
                        <p class="card-text">Some quick example text to build on the card 
                        title and make up the bulk of the card's content.</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-sm-6 col-md-4">
            <div class="card border-white">
                <div class="card-header">Heading 3</div>
                    <div class="card-body">
                        <p class="card-text">Some quick example text to build on the card 
                        title and make up the bulk of the card's content.</p>
                    </div>
                </div>
            </div>
        </div>

</div>

@endsection

Activity icon

Replied to [L5] Create 3 Columns For Cards Using Bootstrap Row Class

Can you repost your blade file now that you have made the changes?

Activity icon

Replied to [L5] Create 3 Columns For Cards Using Bootstrap Row Class

Try ending the row immediately after your 12 column caption and then create a new row below it for your cards.

Oct
04
2 months ago
Activity icon

Replied to Managing DB Schema Changes On A Production Database

I use a github repository along with Forge to manage my production site. With Forge when you run a deployment from their UI it pulls the most recent copy from my github account and automatically runs a migration.

It's just like magic. :)

Oct
01
2 months ago
Activity icon

Replied to Using AND/OR Operators Together In Controller

I think you were on the right track as I have similar code in one of my projects to bracket the ands & ors.

Below I have reformatted your code a bit (to make it easier for me to read) and to pull the get() statement out of the second query. I have not tested to see that this is syntactically correct but when you have a chance please try this.

 $single_contact_add = Datainfo::where(function ($query) 
    { $query->where('uploaded_by', '=', Auth::user()->id)
        ->orWhereIn('uploaded_by', '=', Auth::user()->getchild(Auth::user()->id)); 
    })

    ->where(function ($query) 
    { $query->where('id', '!=', $group_contacts)
        ->orderBy('id', 'DESC');
    })

    ->get();
Activity icon

Replied to 3 Tier Architecture

Normally the Presentation tier is the load balancer. Even if your client wishes to internally host I still recommend the series as it discusses all of the basics in setting up a multi-tier Laravel application.

Activity icon

Replied to 3 Tier Architecture

Hi Zacky this type of configuration usually results in a load balancer -> one or more app servers -> one or more db servers.

If you would like to view a video series that walks you through the steps there is one here on laracasts : https://laracasts.com/series/learn-laravel-forge

Sep
26
2 months ago
Activity icon

Replied to Strange Password In My Database

Is there any chance that the user in question might have two accounts, one with a hashed pwd and then this one?

Activity icon

Replied to Strange Password In My Database

I would suggest that this password was not updated via your Registration Controller as it would be hashed like the others. I think you likely have a security issue where someone has write access to your database either through some form of SQL injection, application bug or directly from another DB management tool.

Sep
23
2 months ago
Activity icon

Replied to Blade Indent/autocomplete Plugin Is Not So Good In Phpstorm

  • 1

I would like to find a solution to this as well.

Sep
19
2 months ago
Activity icon

Replied to Dropped Queries By ~29,980 But Still 30+ Seconds To Load...

I assume that your queries are running against tables with significant number of records in them. Are you filtering the data with where statements and if so do you have indexes on the fields being queried?

Sep
16
3 months ago
Activity icon

Replied to After Copying A Laravel Project Blade Views Not Reflecting Changes

Perhaps your domain name/ server instance is not pointing to the code base that you think it is?

Activity icon

Replied to CSS Not Working !

Using the same tool if you you select any element and explore the attached sytles what do you see? If you are not seeing an error I would then think that your css styles are being overriden?

Also using the developer tool you should be able to explore your html document and in the header where you see your stylesheet being applied it should be a link where you can click on it and see that you in fact do have content in your attached stylesheet.

The most common issues are:

  1. Your style sheet does not load at all which should trigger an error visible in the console.
  2. Your styles are being overridden by another stylesheet.
  3. Your sass build is in fact creating an empty or malformed file.
Activity icon

Replied to CSS Not Working !

If you use Google Chrome and visit > More tools > Developer tools do you see any errors in the console tab?

Sep
13
3 months ago
Activity icon

Replied to Query Efficiency

With Eloquent queries there is a concept called Eager Loading where in the Eloquent query you specify which other records to load using a 'with' statement. I recommend that you read up on this.

https://laravel.com/docs/5.8/eloquent-relationships#eager-loading

Sep
12
3 months ago
Activity icon

Replied to Forge Down?

I understand that this is being addressed now: https://twitter.com/themsaid/status/1172166429648543744

Activity icon

Replied to FORGE IS DOWN

I understand that this is being addressed now: https://twitter.com/themsaid/status/1172166429648543744

Sep
11
3 months ago
Activity icon

Replied to User Specific Alerts With Many Filters

Lets call the data that people are uploading Opportunites.

I would look to create your system like this.

Let people upload Opportunities and as they are uploaded you set a flag on their record saying not processed.

On a timer, lets say once per hour you kick off a job that walks through all of your users and for each of them you run a routine that compares their filters against the new Opportunities and sends notifications as needed. Once done all of the Opportunities you just processed are flagged as complete.

As new Users join your system you set a flag on their saying not processed.

On a timer, lets say once per day you kick off a job that walks through the new users and for each of them you run a routine that compares their filters against ALL Opportunities and sends them notifications as needed.

For the 'flag' on Opportunities and Users I would use an numeric integer batch number that you increment just before kicking off your long running jobs such that you don't have a new Opportunity or User created while your job is running that is accidentally skipped.

Sep
10
3 months ago
Activity icon

Replied to Laravel Datatables Search Error

Is this a production machine or are you testing this via 'php artisan serve' server?

Sep
09
3 months ago
Activity icon

Replied to Updating Database On JQuery.ajax Call

Something like:

foreach ($pages as $page) {
  foreach($page->children as $children) {
 
    // your update logic here
    // start with a dd($page,$children) to dump the values returned to your controller

   }
}
Activity icon

Replied to Using Related Model True/false Functions In Eloquent Queries

The definition of the Accessor requires specific naming structure.

In your case it would be GetLatestassignmentAttribute the Get and Attribute portion of the naming performs some Larvel magic.

Defining An Accessor To define an accessor, create a getFooAttribute method on your model where Foo is the "studly" cased name of the column you wish to access. In this example, we'll define an accessor for the first_name attribute. The accessor will automatically be called by Eloquent when attempting to retrieve the value of the first_name attribute:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    /**
     * Get the user's first name.
     *
     * @param  string  $value
     * @return string
     */
    public function getFirstNameAttribute($value)
    {
        return ucfirst($value);
    }
}
Activity icon

Replied to Using Related Model True/false Functions In Eloquent Queries

Typically you would use an Accessor for this type of dynamic field generation.

Have you reviewed: https://laravel.com/docs/5.8/eloquent-mutators

Sep
06
3 months ago
Activity icon

Replied to Percentage Difference Between Dates

Basically you would need at least three dates to create a percentage as a percentage is a ratio.

As an example you if you wanted to know today as a percentage of days in the month. You would need the start date, end date and today's date.

Aug 1 -> Aug 30 is 30 days Aug 1 ->Aug 6 is 6 days

Your percentage comes as 6/30 = .2 or 20%

Date calculation example https://laracasts.com/discuss/channels/general-discussion/difference-between-two-carbon-dates

Aug
28
3 months ago
Activity icon

Started a new Conversation Forge Branch

Hi I have both a production site and testing site maintained via Forge. Until today both production and testing were set up to use my Master branch which was based on Laravel 5.7. I want to move to Laravel 5.8 so I created a branch (called Upgrade-to-5.8) and with my IDE worked through the various issues.

I now have both Master and Upgrade-to-5.8 branches available on Github.

In Forge I accessed my test server site and changed the Deployment Branch from Master to Upgrade-to-5.8 and ran Deploy Now. Below is a portion of the deployment log where it appears that the master branch was deployed rather than my Upgrade-to-5.8 branch.

Is there something else that I need to do to change my branch on this site?

Wed Aug 28 21:12:57 UTC 2019
From github.com:XXXXXX(Changed for security purposes)
 * branch            master     -> FETCH_HEAD
Already up to date.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
Aug
20
3 months ago
Activity icon

Replied to How To Sync Attributes In A Specific Order ?

On my pivot tables I always add an id field and make it the primary index just like every other table used within Laravel. This would provide you with a method to sequence your records if you managed the sequence when they are created via the previously described ->attach method.

Aug
06
4 months ago
Activity icon

Replied to Error In Migrate In Laravel 5.5

Can you also share your migration file?

Aug
01
4 months ago
Activity icon

Replied to Tips For Seeding Production Tables From Devel Environment

That is a great idea thank you!