eludic

Experience

13,110

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 127 Lessons Completed
  • 0 Favorites

14th June, 2018

eludic started a new conversation MySQL Error: [ERROR] InnoDB: (Duplicate Key) Writing Word Node To FTS Auxiliary Index Table. • 2 months ago

I see so many entries saying "[ERROR] InnoDB: (Duplicate key) writing word node to FTS auxiliary index table." in the MySQL error log. How do I replicate and fix this issue?

I am using MariaDB 10.2 as the database.

I am clueless.

10th January, 2018

eludic left a reply on Validate Two Array Form Fields • 7 months ago

Nevermind, managed to get this work. Changed the code slightly. Changed it to:

fieldname[2][text1] and fieldname[2][text2] then used the required_if validator:

'fieldname.*.field2'      =>  'required_with:fieldname.*.field1',

eludic started a new conversation Validate Two Array Form Fields • 7 months ago

I have an HTML form where two input fields are co-related. Both fields are input text fields with array[] assigned to them as the fields are dynamically added to the form.

I want Laravel to validate that value of fieldone[2] cannot be empty if fieldtwo[2] is filled. How do I this for all array fields i.e. fieldone[a] cannot be empty if fieldtwo[a] is filled and fieldone[b] cannot be empty if fieldtwo[b] is filled.

Thanks.

eludic left a reply on Migrate And Seed Only Once • 7 months ago

Okay. Thanks :)

5th January, 2018

eludic left a reply on Migrate And Seed Only Once • 7 months ago

Yeah I want this code to only run once and not the next time when db:seed command is executed

eludic left a reply on Migrate And Seed Only Once • 7 months ago

Makes alot of sense. Was thinking the same while version application version. However this one does not have this feature. In that case how do I prevent it from running again?

eludic started a new conversation Migrate And Seed Only Once • 7 months ago

I have an application which needs to be updated. The application database table "institute" already has a column "report" which is an int value. This needs to be changed and I would be adding a new column called "reports" which will populate according to client submission.

I have already written the migration for the same and added the following code to the DatabaseSeeder.php file:

[code] $institutes = DB::table('institutes')->get(); foreach($institutes AS $institute){

        if(!empty($institute->report)){
            $reports[] = $institute->report;
            $jsonreports = json_encode($reports);

            // Store this and reset file_auditreport
            DB::table('institutes')->where('id', $institute->id)->update([
                'report'      =>  0,
                'reports'     =>  $jsonreports
            ]);
        }
    }

[/code]

My question is, how can I make sure Laravel runs this only once and not everytime I run the command php artisan db:seed as I do not want Laravel to run this in the future if in case there is an update to be made.

Hope this makes sense.

15th June, 2017

eludic left a reply on Multiple Sessions From Same Browser • 1 year ago

@Snapey Correct!

14th June, 2017

eludic left a reply on Multiple Sessions From Same Browser • 1 year ago

Thanks for your input. I was hoping to be able to create different session IDs for each login type but I do not think that is quite possible in Laravel.

13th June, 2017

eludic left a reply on Multiple Sessions From Same Browser • 1 year ago

@jlrdw Admin can be user but not all users are Admin so not all have access to Admin panel.

eludic left a reply on Multiple Sessions From Same Browser • 1 year ago

Thank you for your answers:

@Cronix I plan to make this software commercially accessible hence have to look into all kinds of possibilities including the users using the same browser for multiple logins.

Due to this I am exploring this angle. Have used softwares likes Kayako who obviously use their own framework where multiple logins using the same browser is possible. This is due the fact that they create multiple sessions for each login.

Still exploring how this is possible in Laravel.

11th June, 2017

eludic left a reply on Multiple Sessions From Same Browser • 1 year ago

Hi, Thanks for your reply. The queries I posted were issues I faced after following that video. Still looking for answers. Please help.

Thanks

9th June, 2017

eludic started a new conversation Multiple Sessions From Same Browser • 1 year ago

Hi, I am creating an application with different set of users - clients, staff and admin. Each one will have it own set of interface so a staff cannot access admin interface and so on.

I have managed to tweak Laravel for multi-auth system but the issues which I am facing are:

  1. Sessions - Laravel still uses the default session assignment system for logged in users so when a user is accessing the client front end the user_id is captured from user table while for admin interface the user_id is captured from the admin table. While doing so the session id remains the same when accessing the user and admin interface from the "same" browser. I noticed this while testing the system.

I need to tweak Laravel to create a separate session record when a user accesses the staff/admin panel and the user interface. Any hint on how I can do this? Currently I am using separate Guards for auth check so it verifies with the correct database table.

Ideally when the user successfully logs into the admin panel a fresh session record should be created a maintained separately. I think this will fix the issue of auto switching of "user_id" in the sessions table due to same session ID.

  1. I think this has to do with the issue above. On the login form when I select "Remember Me" for client side, it works fine but on the same browser if I choose "Remember Me" for Admin form I get a Token Mismatch error. I think that is because the session IDs are the same. If this is not the issue, let me know how I can fix this.

Thanks.

14th May, 2017

eludic left a reply on Storage Symlink • 1 year ago

Hi, You can ignore the question. I managed to fix it. The issue was due to incorrect path to the portal/storage/app/public/.

The path was incorrect even while creating the symlink via php artisan. I had to manually set this to make it work.

Hope this helps others too.

Regards,

Hiren Mehta

eludic started a new conversation Storage Symlink • 1 year ago

I developed the project on my local host which I now moved to a production server. Laravel fails to retrieve the files from the storage directory. I manually set the symlink to:

ln -sf home/user/portal/storage/app/public/ home/user/public_html/domain.com/portal/storage/

And ran the php artisan storage:link which fetches the result: The "public/storage" directory already exists.

When I ls -la to the public_html/domain.com/portal directory I see the result: storage -> home/user/portal/storage/app/public/

The URL for the file is set to -- http://www.domain.com/portal/storage/documents/4_filename.pdf which is correct but when the URL is opened in the browser it gives a 404 error.

When I click on public_html/domain.com/portal/storage via FTP it shows the content from portal/storage/app/public/ but when I try to cd public_html/domain.com/portal/storage via SSH it gives the error:

-bash: cd: storage: No such file or directory

I have spent too much time to work this but have not yet found a resolution. Can anyone please help me?

Thanks,

Hiren Mehta

eludic left a reply on Protected • 1 year ago

Thanks. That really helps!

3rd May, 2017

eludic started a new conversation Protected • 1 year ago

I am learning Laravel and have seen quite a few videos on the site. I see Eloquent has a feature to protect a few database fields which when passed displays a mass assignment exception error. My question is, if the field is protected then how do you pass this value via code to process the query.

For instance there is a subscription based website which has a subscription model and a user model. The userid is protected for the subscription model.

In this case how do you pass this value when a new subscription is created?

I am sorry if I do not sound too clear but believe me I am trying :)

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.