omniware

omniware

Member Since 3 Years Ago

Bangalore

Experience Points 28,860
Experience Level 6

1,140 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 274
Lessons
Completed
Best Reply Awards 0
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.

28 Jul
1 month ago

omniware left a reply on Handling Email Bounces And Complaints For Amazon SES

You can use this package https://github.com/jdavidbakr/mail-tracker. You can associate SNS to your bounce complaint and even delivered message and this package will trigger events in laravel where you can update the subscription accordingly.

12 Jul
2 months ago

omniware left a reply on Mounted Drive To 'storage/' Causes Valid Cache Path Error

Hi,

You need to add a 'framework' folder inside your new storage location. Your framework folder should contain 'cache', 'session' and 'views' folders.

I verified this one Laravel 5.2 and it works.

09 Aug
1 year ago

omniware left a reply on How To Make A Data Persist Temporarily Until Approved By An Admin

Laravel 5.5 onward we have this package called [eloquent-approval] (https://github.com/mtvs/eloquent-approval) for maker-checker or review-approval kind of setup.

05 Oct
1 year ago

omniware left a reply on Forge And AWS In 2017

@mdurao Yes, the thing is in aws you need to get to newly created subnet and turn on option to auto assign IP to new machines... I will put more details soon... Let me know if it helped.

01 Oct
1 year ago

omniware left a reply on Dotenv Of Queue

Any one on this?

11 Jul
2 years ago

omniware started a new conversation Dotenv Of Queue

I have three dot env, default .env for example.com, .env.sub1 for sub1.example.com and .env.queue2 for sub2.example.com

I am able to load different .env when I bootstrap using the following code in bootstrap/app.php. This works really well when I access the websites.

$env = $app->detectEnvironment(function () {
    $environmentPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
    $environmentFile = null;
    switch (getenv('HTTP_HOST')) {
        case 'sub1.example.com':
            $environmentFile = '.env.sub1';
            break;
        case 'sub2.example.com':
            $environmentFile = '.env.sub2';
            break;
    }
    if (!empty($environmentFile) && file_exists($environmentPath . $environmentFile)) {
        Dotenv::load($environmentPath, $environmentFile);
    } else {
            // .env will be in affect, do nothing
    }
});

This also works really well when your QUEUE_DRIVER is set to sync.

But the problem when my QUEUE_DRIVER is set to beanstalkd it take the environment variables always from .env.

Where is beanstalkd queue loading the .env while executing a queued job.

Thanks, K

29 Jun
2 years ago

omniware left a reply on Problem After Changing The Port For SSH

I raised a few complains on forge "contact support" but no even bothered to answer after two weeks. Looks like if we are using forge we are on our own.

omniware left a reply on Problem After Changing The Port For SSH

Still it doesn't seems forge ssh login can be changed use a different port than 22.

I am using Forge with AWS, after installing OSSEC every hour there is a bot attempting to access my server on port 22 and I get OSSEC messages like this:

`OSSEC HIDS Notification. 2017 Jun 29 09:14:36

Received From: My-Test-Server->/var/log/auth.log Rule: 1002 fired (level 2) -> "Unknown problem somewhere in the system." Portion of the log(s):

Jun 29 09:14:34 My-Test-Server sshd[7279]: error: maximum authentication attempts exceeded for root from 181.113.202.8 port 54819 ssh2 [preauth]`

all these IPs are in this ban list https://lists.blocklist.de/lists/ssh.txt

On my other server without forge where I changed ssh port to 22122 I do not get such attempts at all.

13 Apr
2 years ago

omniware left a reply on Laravel 5.1 Encrypt In JavaScript And Decrypt In Laravel.

Finally I was able to use cryptjs to do this and this little sample code helped a lot https://github.com/brainfoolong/cryptojs-aes-php. Of course I couldn't use Crypt::decrypt.

12 Apr
2 years ago

omniware left a reply on Laravel 5.1 Encrypt In JavaScript And Decrypt In Laravel.

If I do not want to use Laravel Crypt and achieve encrypting in AES-256-CBC on Javascript client side and decrypt on Laravel side, what are my options.

I know SSL already encrypts things, but I have peculiar situation.

omniware started a new conversation Laravel 5.1 Encrypt In JavaScript And Decrypt In Laravel.

Hi I need to implement the Laravel's Crypt::encrypt($payload, $key) in Javascript/Jquery, that generate the cipher_text in a format that can be decrypted using Laravel's Crypt::decrypt function.

The Laravel's default Crypt functions uses APP_KEY as key to encrypt and decrypt. But as I have my own key to be used I used the following code to encrypt and decrypt.

private function encrypt($plain_text, $key)
{
    /* set the key for encryption */
    $encrypter = new \Illuminate\Encryption\Encrypter(substr($key, 0, 32), Config::get('app.cipher'));
    /* encrypt the plain text */
    $encrypted = $encrypter->encrypt($plain_text);

    return $encrypted;
}

public function decrypt($cipher_text, $key)
{
    /* set the key for decryption */
    $decrypter = new \Illuminate\Encryption\Encrypter(substr($key, 0, 32), Config::get('app.cipher'));
    /* decrypt the cipher text */
    $decrypted = $decrypter->decrypt($cipher_text);

    return $decrypted;
}

The only issues now is how to encrypt in Javascript. I tried CryptoJS but the encrypted string that it generates is very different from what Crypt::encrypt generate, and I get Exception DecryptException in BaseEncrypter.php line 45:The payload is invalid.

Can you please help?

20 Mar
2 years ago

omniware left a reply on Laravel 5.4 Use Different Column Name And Table For Authentication

@jlrdw Thanks for your response, but that question answers how phone or email can be used for logging in. I am trying to overload a few functions, but I see there are quite a few places where users are hard-coded in the code.

Actually I am migrating my Laravel 5.1 project to Laravel 5.4. these bottle necks are at migration from 5.2 to 5.3.

omniware left a reply on Laravel 5.4 Use Different Column Name And Table For Authentication

No answers, is this that difficult to use a different table with different column names for auth in laravel 5.4?

19 Mar
2 years ago

omniware started a new conversation Laravel 5.4 Use Different Column Name And Table For Authentication

What are the changes I need to do, after auth:make in Laravel 5.4 to use admins Table with admi_login and password to login, register, password reset and forgot password . The structure of admins table is as following.

        $table->increments('admi_id');
        $table->string('admi_login');
        $table->string('admi_email')->unique();
        $table->string('admi_password', 60);
        $table->string('admi_active', 1)->default('n');
        $table->string('admi_remember_token', 100)->nullable();
        $table->timestamp('admi_insert_datetime');
        $table->timestamp('admi_update_datetime');

and structure of admin_password_resets tables is

        $table->string('email')->index();
        $table->string('token')->index();
        $table->timestamp('created_at');
07 Feb
2 years ago

omniware started a new conversation Forge And AWS In 2017

I created a EC2 using Forge, it started to build the machine, after a long time when I refreshed the new machine build row disappeared.

When I checked EC2 on AWS, machine is created, but there is no IP assigned to it.

Also when it is successfully created on forge sometimes I do not receive email from forge with sudo passwords.

Is this something known, is there a workaround to do the server creation correctly?

18 Jan
2 years ago
16 Jan
2 years ago

omniware started a new conversation Updating Config On Runtime For A User

I am using Laravel 5.1

I created a function to get smtp info from db for a user $mail_config=STMPDetails::where('user_id',36)->first() and then I can just call config helper function and pass the array to set config value config($mail_config). and then I call Mail::queue function.

but before it reaches [email protected]/laravel/framework/src/Illuminate/Mail/TransportManager.php where it reads the configuration again to send the mail, mail config are changed to the one specified in .env file.

Another thing to note is Mail sending function is in a Listener

I am not able to figure out where can I call the function such that configuration changes are retained before mail is sent.

Thanks, K

11 Jan
2 years ago

omniware started a new conversation What To Put In Server Providers->Amazon->Key/Secret

I created an Ubuntu server on Amazon AWS. I registered for Forge, and trying to configure it. Selected source control to be Bitbucket. Now I am not sure what to put in key and secret after selecting Amazon in Server Provider Section.

20 Dec
2 years ago

omniware left a reply on Different .env File For Different URL

This is how I solved it, in Laravel 5.1

$environmentPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
$environmentFile = null;
switch (getenv('HTTP_HOST')) {
    case 'whitelabel.com':
        $environmentFile = '.whitelabel.env';
        break;
}
if (!empty($environmentFile) && file_exists($environmentPath . $environmentFile)) {
    Dotenv::load($environmentPath , $environmentFile);
}

omniware left a reply on Different .env File For Different URL

@kamun I used Dotenv::load before seeing your response, but loadEnvironmentFrom look more promising, Thanks.

Update, loadEnvironmentFrom did NOT work in Laravel 5.1

18 Dec
2 years ago

omniware started a new conversation Different .env File For Different URL

I have a Laravel application running at www.myapp.com with its own logos and all, the logo file location is defined in a .env file.

Now I want to have a white-label of www.myapp.com application on www.whitelabel.com with its own logo.

I need to have two different .env files that need to be loaded at runtime e.g.

  • for www.myapp.com in URL it should use .myapp.env file
  • and for www.whitelabel.com it should use .whitelabel.env file.

Is this possible in Laravel 5.1, if yes how?

04 Dec
2 years ago

omniware left a reply on Has Many Relationship Create

I run this as a Job every night at 1 am it does two things.

  1. get entries from the entire system and make entries in transactions table for everything before 12 am.
  2. then it has to aggregates these newly added transactions and puts them in aggregated table

Process makes sure these transactions are aggregated only in one of the aggreated_transaction rows

You are rightly pointed my objective here, but didn't understand how your suggestion improves the situation?

omniware started a new conversation Has Many Relationship Create

I have two tables: transactions aggregated_transactions

I run a job every night that will create entries in transactions table that is followed by job to aggregate these new transactions stored in the transactions table by day and user and put them in aggregated_transactions table.

There is a hasMany relationship between aggregated_transactions and transactions table.

Thus after a aggregated transaction is created I need to update the transactions table with the newly created aggregated transaction ID.

Issues in this approach is

  1. I have to create entries in aggregated transaction one by one, even thou I have aggregated array that I could have bulk inserted in a go.
  2. After every aggregated transaction is created I need to update transactions table and need to also keep track of the transaction IDs I need to update.

Thus running so many DB queries (using SQL it is one query task, but I need to use Eloquent for consistency)

Is there a better way to do this using eloquent.

I was thinking if I could instead of hasMany have a ManyToMany relationship and keep track of the connection between two tables in a third pivot table.

Thanks, K

24 Nov
2 years ago

omniware left a reply on L5: API Validation And The New FormRequest Approach

With Laravel 5.3 I did following in app/Http/Requests/PostRequest.php

/*
 * Validator instance updated on failedValidation
 *
 * @var \Illuminate\Contracts\Validation\Validator
 */
public $validator = null;

/**
 * Overrid Handle a failed validation attempt.
 *
 * @param  \Illuminate\Contracts\Validation\Validator  $validator
 * @return void
 *
 * @throws \Illuminate\Validation\ValidationException
 */
protected function failedValidation(\Illuminate\Contracts\Validation\Validator $validator)
{
//      throw new \Illuminate\Validation\ValidationException($validator, $this->response(
//          $this->formatErrors($validator)
//      ));
    $this->validator = $validator;
}

In my Controller function, I captured the $validation object

public function create(PostRequest $request)
{
    if (isset($request->validator) && $request->validator->fails()) {
        throw  new \Exception('GEN-INVALID-PARAMS - ' . $request->validator->messages()->first(), 999);
    }
...

Hope this helps

08 Nov
2 years ago

omniware started a new conversation Forge Vs Forge Plus

I am planning to get Forge. but not able to decide between Forge and Forge Plus.

Forge Plus says "Share Servers With Teammates." does this only mean teammates will have additional logins in forge site to look at my single server (assume I have only one server). or there will be users created on my single server for each user with different privileges?

Does Forge create users that I can use to directly access my server via putty?

05 Nov
2 years ago

omniware left a reply on Best Development To Production Route

@sunergetic thanks for the hook pointer.

@willvincent I am thru the tutorials you shared, now I understand the flow I need to have, but I am thinking to replicate what git flow does instead of asking all my developers to learn gitflow and start following new process.

I will change step 4 to Merge to develop branch and the moment something merge to develop branch it will be pushed to a staging server, where we also do run the phpunit tests (which we now plan to write) as well do manual testing. Then I can merge the develop branch to master that would automatically push code to prod server.

I hope this plan would work, any suggestions here?

03 Nov
2 years ago

omniware left a reply on Best Development To Production Route

@willvincent thanks I go thru it today.

02 Nov
2 years ago

omniware left a reply on Best Development To Production Route

Git-flow seems interesting... Pointers to any good tutorials (preferably video tutorials) please. Thanks.

omniware left a reply on Best Development To Production Route

You are right step 1-4 doesn't change and really the pain point is testing before it goes to prod, we do not have unit test cases, we do manual testing and it is right now directly on production server (dangerous, thou we first in local dev env), there is no test or staging env.

omniware started a new conversation Best Development To Production Route

What is the best development to production route with Laravel project.

Current dev tools: XAMPP 7.0 (with php 7 and mysql) on local machine with developers fav IDE on Windows 10. Current production tools: Apache2 with php7 and mysql on Ubuntu 14 running on AWS EC2 Current process:

  1. Development happens on local machine.
  2. Code is Committed in git and branch pushed to bitbucket
  3. Pull request is created.
  4. Code review and Merge to master.
  5. On prod server, git pull origin master && composer install && php artisan migrate && php artisan cache:clear to deploy the code.

This process is becoming difficult to manage as the team size is growing.

21 Oct
2 years ago

omniware left a reply on SMTP Setting For Each USER

@Braunson Thanks, This is helpful, probably I will create a package for this myself.

20 Oct
2 years ago

omniware left a reply on SMTP Setting For Each USER

@wolle404 I am looking for a plugin if there is any (I couldn't get any in my search)

@Snapey user will put there smtp credentials. and I will use those to push there mails to there own audience.

omniware started a new conversation SMTP Setting For Each USER

Is there a laravel package for setting up smtp setting for each user, user account is going to send mails to his audience?

15 Oct
2 years ago

omniware started a new conversation ACL And Admin

Registering an Organization in my application with default superuser, who can then add/edit/delete users and associate them with a role (having various permissions).

what is the best way to do this in Laravel 5.3

12 Oct
2 years ago

omniware left a reply on Storing Dynamic Columns

I will give that a try with mangodb.

I really liked the concept IsraelOrtuno/Eavquent, but it is still under development, it doesn't solve the efficiency problem, but we can easily query the models. I was trying it, there are issues that I am trying to resolve but insufficient documentation is not not helping.

omniware left a reply on Storing Dynamic Columns

Can I use both mysql and mangodb in one project. I will using mango only for storing these dynamic data?

omniware left a reply on Laravel Passport Error - ServerException In RequestException.php Line 107:

On my consumer.dev when I changed the database to point to same database as the one used for passport.dev everthing fell in place, but it is not logical to do so, Can anyone tell why should I have the same database on consumer.dev.

passport.dev .env file

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=passport
DB_USERNAME=root
DB_PASSWORD=null

consumer.dev .env file

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=passport
DB_USERNAME=root
DB_PASSWORD=null

omniware left a reply on Storing Dynamic Columns

Thanks for your response, the problem with json string it is not easy to query. I use server side data tables using yajra's datatables package, that needs a builder instance to work on.

Second approach is eav model but that seems very inefficient to query, thou flexible it is also an anti pattern.

Any other way to achieve this in a relational format , I do not mind complexity, but it should be flexible and easy to query using a SQL query at the end of the day.

11 Oct
2 years ago

omniware started a new conversation Storing Dynamic Columns

I need a data model to store and then easily retrieve data using Eloquent for the following scenario.

My User logs in and creates a Custom Form 1 with 3 fields (name, email, dob) and distributes it to his Friends. 15 Friends fill the form 1. My user user creates another Custom Form 2 with 4 Fields (name, email, phone, subject) and distributes to his Teachers. 6 Teachers fill the form 2.

Now my User needs to see the data for

  • Form 1 (having 15 rows and 3 columns)
  • Form 2 (having 6 rows and 4 columns)

What is the best way to deal with dynamic number of columns?

08 Oct
2 years ago

omniware started a new conversation Route Without Default Middleware

In Laravel 5.3, when I add a route in web.php it adds a default web middleware to it. I do not to add the default middleware but my own middleware only. How can I remove the default route to not apply no a specific route? I need this specially for the few routes where I do not want verify csrf token, I can add the route in the exception list, but this is something that is going in my package.

07 Oct
2 years ago

omniware left a reply on AJAX Form Validation Using Request

I am on laravel 5.1, and not yet started using vuejs

omniware started a new conversation AJAX Form Validation Using Request

I usually use Request to validate form data, e.g. For my TestController, I use TestRequest to define my rules. I case of ajax I use something as following, i.e. making a validator in controller's function,

// Setup the validator
$rules = array('username' => 'required|email', 'password' => 'required');
$validator = Validator::make(Input::all(), $rules);

// Validate the input and return correct response
if ($validator->fails())
{
    return Response::json(array(
        'success' => false,
        'errors' => $validator->getMessageBag()->toArray()

    ), 400); // 400 being the HTTP code for an invalid request.
}
return Response::json(array('success' => true), 200);

How can I use my TestRequest with a ajax request, that would also prepare the proper error response

05 Oct
2 years ago

omniware left a reply on Sync Client Instances

Exactly, Thanks. Laravel Echo

omniware started a new conversation Sync Client Instances

I saw a video few months back, Taylor demonstrate a technic in laravel where two different browser windows were in sync, change in a value in one window reflected the change in another window, but I am not able to recall where I saw it and what is it called. Can someone help me recall it.

04 Oct
2 years ago

omniware left a reply on Safe Guarding Files Stored In AWS S3

@kobear that means in img tag I should have a route like http://mysite/images/abc.png and a controller fetch content of this file from aws url https://s3.ap-south-1.amazonaws.com/test-bucket/abc.png on to my server and pass it to my users browser.

Right now as all files are exposed to internet my img tag has direct src to aws url.

Now following the controller approach there will be additional stress on my server as well apart from the transfer that happens from S3 to my server.

Earlier I was having all these user image files in my storage folder and I was using the similar approach as you mentioned. I am not seeing the addvantage of using S3 like this.

omniware started a new conversation Safe Guarding Files Stored In AWS S3

I started using S3 to store my user files using laravel-mediable package, it all works fine, but all files stored in S3 are accessible directly via internet when the url is known.

Only my app should be able to access the file and show it up only when user is logged in,

What is the way to set this up?

18 Sep
2 years ago

omniware started a new conversation Micro-Site Fro User Using Laravel

I want to create a micro-site (single page) for each of my registered user with a subdomain like user1.exampl.com, user2.example.com, what is the best way to do this using laravel

04 Aug
3 years ago

omniware left a reply on Starter Application (Vue.js, Laravel, Dingo, JWT)

@ciurinho I am sure by now you would have figured it all out, last night when I was trying to install this I got the same error, How did you solve the issue?

26 Jul
3 years ago