Ravish

Ravish

Member Since 8 Months Ago

India

Experience Points
7,430
Total
Experience

2,570 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
53
Lessons
Completed
Best Reply Awards
2
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 2
7,430 XP
Aug
04
13 hours ago
Activity icon

Awarded Best Reply on Dropzone With Mutifields Form

Add dropzone as a field in the form.

<!--...other fields-->
<div id="my-dropzone" class="dropzone"></div>
<input type="submit" id="submit" value="Submit">

write the following code while defining dropzone in javascript

init: function () {

            var dz = this;


            $btn.click(function (e) {

		//prevents the form from submitting
                e.preventDefault();

		//tell dropzone to process the form
                dz.processQueue();
            });

            this.on('sending', function (file, xhr, formData) {

                let data = {};

                // Append form fields to the foemData object that the dropzone sends to server
                $.each($form.serializeArray(), function (key, el) {
                    data[el.name] = el.value;
                    formData.append(el.name,el.value);
                });

                formData.append('content',getEditorContent());

		//or append data to formData object manually
		//e.g. just fetch whatever data you want using selector and append it to formData object
            });
        },
Activity icon

Started a new Conversation Service Container - Real World Example

What is the real world use of a service container and service provider? All the tutors talk on the video is how to make it work and how to bind values from a static location. Can anyone explain a real world example of this concept in such a way that even average skilled developers can understand it?

Activity icon

Started a new Conversation Career Path Tips For A Laravel Developer.

According to my research, Laravel developer's average annual salary is 50-80,000 USD. In my country, India, it is nearly 8000 USD. In India. No doubt there area developers who are making exceptional money but there are very few and top level developers who has really exceptional skillset and years of experience. But for a average developer, it is difficult to cross 8000 USD monthly income. That's why students tend to move to countries like australia, US, canada etc. Because of this reason, I am wondering if I should master laravel development and other technologies to become a better full stack developer or should I switch to growing field like data science. I really do not want to switch. I really want to get to the bottom of laravel and nail it in next upcoming months. But I do not understand how should I make a career out of it as a freelancer with the amount of salary they are paying here. I want to understand what are the ways I can approach clients, what is the future scope in this framework and how to reach out to international market.

Activity icon

Commented on Laravel Facades Demystified

my mind is exploded right now !

Activity icon

Commented on Automatically Resolve Dependencies

You sound like one of those voices from my meditation audios jeffrey !

Activity icon

Commented on Automatically Resolve Dependencies

Are route bindings based on the same concept ?

Route::get('resource/{model}',function(MyResourceModel $model){
	//here laravel automatically fetch the model from database based on id
	//is this done by the same concept?
})
Activity icon

Replied to How Do I Change My Avatar In Laracasts Profile?

@sergiu17 I had to add the website in the website lists. Now its working

Activity icon

Started a new Conversation How Do I Change My Avatar In Laracasts Profile?

I uploaded a picture on gravatar.com. But nothing happens.

Activity icon

Replied to Quickly Counting Records With Eloquent

@snapey Thank you for the explanation ! Can you please explain me how eloquent is not slower in compared to query builder in scenarios like select 10000 records

Activity icon

Replied to Store Extra Data With Payment Gateway Response

Option one is to keep those ID fields nullable. Option two is to create temp_transactions table and save the data there temporary. One you have the IDs that you require, you can store it into transactions table.

Activity icon

Replied to Dropzone With Mutifields Form

Add dropzone as a field in the form.

<!--...other fields-->
<div id="my-dropzone" class="dropzone"></div>
<input type="submit" id="submit" value="Submit">

write the following code while defining dropzone in javascript

init: function () {

            var dz = this;


            $btn.click(function (e) {

		//prevents the form from submitting
                e.preventDefault();

		//tell dropzone to process the form
                dz.processQueue();
            });

            this.on('sending', function (file, xhr, formData) {

                let data = {};

                // Append form fields to the foemData object that the dropzone sends to server
                $.each($form.serializeArray(), function (key, el) {
                    data[el.name] = el.value;
                    formData.append(el.name,el.value);
                });

                formData.append('content',getEditorContent());

		//or append data to formData object manually
		//e.g. just fetch whatever data you want using selector and append it to formData object
            });
        },
Activity icon

Replied to Quickly Counting Records With Eloquent

@tomneal You are retrieving ALL records and then counting. There is no need to fetch all column data from the database and secondly, if ever you want to retrieve these many rows, you should use query builder rather than eloquent. Just try to change your approach to query builder and you will see the difference. Eloquent has more overhead then query builder, which can be seen while doing such huge transactions. 2ndly you do not need to retrive all the data. Select only the ID column and then execute the conditions.

Aug
03
1 day ago
Activity icon

Commented on Display All Tags Under Each Article

36 episodes as if now

Activity icon

Commented on Basic Eloquent Relationships

slow down the video speed

Activity icon

Commented on Basic Eloquent Relationships

same here

Activity icon

Commented on Consider Named Routes

you need to add wildcard in route definition

Activity icon

Commented on Consider Named Routes

Route::resource('/profile', 'ProfileController'); automatically gives routes appropriate names. If you want to have custom names, then you need to write all routes manually with your choice of route names.

Activity icon

Commented on Consider Named Routes

a route is distinguish from other based on 2 factors. URI and REQUEST TYPE. If you have same URI but different request type for example GET in first and POST in second, both routes will get different IDs.

Activity icon

Commented on Consider Named Routes

also, you can change the url and not worry about the changes to reflect where the url is referenced !

Activity icon

Commented on Consider Named Routes

@hellphone it is more readable. There is not technical difference between both approach. You can use any.

Activity icon

Commented on Render Dynamic Data: Part 2

check the variable spelling and make sure you are passing the variable to view from controller.

Activity icon

Commented on Integrate A Site Template

by pushing the left button on your mouse, you can press the download icon.

Activity icon

Commented on Integrate A Site Template

/about => absolute path. about => relative path

Activity icon

Commented on Integrate A Site Template

Whatever files your views will need to access should reside in public folder. Which usually are css, js and media files such as images videos etc. If you are writing raw css and js then you should directly save those files in public folder. However, if you are using something like SASS, which is CSS pre-processor, then you should store it in resource folder and use laravel mix to compile it to the public folder internally. Now, if you have downloaded a template, it would have styles and script files. Copy and paste all of those files in public folders. Copy the template html and paste it in files that reside ni resources/view and then change the script and style tags in the html and make them point to the files that you pasted in public folder using function asset()

Activity icon

Commented on Layout Pages

correct

Activity icon

Commented on Business Logic

@khawarbajwa It looks like you are not using $table->timestamps() method. By default eloquent model's timestamp property is public $timestamps = true;. So everytime you save or update a record, eloquent internally tries to inject the time to columns created_at and updated_at. If you have not kept the statement $table->timestamps() in the migration, it means the table does not have timestamp columns. You need to specify this in eloquent model by adding this statement in your eloquent file. public $timestamps = false;

Activity icon

Commented on Business Logic

@the_noob Putting any logic in Model that interacts with the database is a great idea. However if you are using laravel's query builder instead of eloquent, then you will have to write that logic again as you cannot use eloquent's methods in query builder. I worked in a huge corporate project where we used eloquent to deal with database. But when we had to query a HUGE table, we used query builder and wrote raw sql quires. Eloquent is a great API but it also comes with overhead which is noticeable when working with huge data for example selecting 1000 rows. Here eloquent will create 1000 model objects which will definitely slow down the performance. So answer to your question is yes, you can put the business logic in eloquent model files, but if you are ever planning to use raw sql to query the database, you wont be able to use that particular logic.

Activity icon

Commented on Business Logic

@samuel-torres It is indeed a great logic. But consider this. You have million records in a table. And you want to search that table using a column. What will be faster, searching through a boolean column or a timestamp column !

Activity icon

Commented on Business Logic

can you write down all the code you wrote in tinker?

Activity icon

Commented on Generate Multiple Files In A Single Command

@robertwt7 When I started with laravel, I did not used to follow the naming conventions. and coding guidelines. I would make my own rules and be consistent with it. But honestly, I regret doing that. Following the naming conventions is very useful in many cases.

Activity icon

Commented on Generate Multiple Files In A Single Command

@blue928 No, there is no way to do that. With a year of experience in laravel, i can say there is no need if those commands as well.

Aug
02
2 days ago
Activity icon

Replied to Stuck With Select Dropdown Inside A Table

@boubou how about this. Once the table is dynamically loaded, execute a javascript function that will loop through all the rows. Select each row using item.id, find tag and select the option that corresponds to the row data.

Activity icon

Replied to Laracasts Videos Not Playing! (Laravel From Scratch)

@ashishj does the black video screen appear?

Apr
25
3 months ago
Activity icon

Replied to Laravel 5.8 Default Apache Virtual Host Configuration

sudo a2enmod rewrite

then

sudo systemctl restart apache2