Mithridates

Mithridates

Member Since 4 Years Ago

Tehran

Experience Points 31,545
Experience Level 7

3,455 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 282
Lessons
Completed
Best Reply Awards 1
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.

29 Jan
1 year ago

Mithridates started a new conversation Good Laravel API Starting Boilerplate

What's a good project/repo for starting to develop an API using Laravel? I've already found https://github.com/apiato/apiato and https://github.com/francescomalatesta/laravel-api-boilerplate-jwt. But didn't get a good feeling for none. The first one for imposing so many new things to learn which isn't necessary also I got a sense that the project's maintainer deviates so much from Laravel core principles. And the second repo for being updated for more than 3 months ago. Please criticize me if you feel you should and also provide some other projects to kick off developing APIs with Laravel.

13 Aug
1 year ago

Mithridates left a reply on Your Experience Of Bug Tracking Tools

@Ricardo Thanks for reply, could you please a summary what purposes those it suffice? Have you felt need for another service?

12 Aug
1 year ago

Mithridates started a new conversation Your Experience Of Bug Tracking Tools

Which service/library you use to track your Laravel bugs in production. How you compare to competitors? Thanks

29 Jul
1 year ago

Mithridates left a reply on Creating A Belongs To Many Relationship

@Dunsti by logic of the application, a student in a specific degree can have exactly 1 consultant. of course that student (Say student a) can have another consultant in another degree.

Does that mean, that a student can have more than one consultant, and more than one degree? yes a student can have more than 1 degree in the system, and can have more than 1 consultant.

The only requirement is that for a specific degree and a specific student the can be exactly 1 consultant.

How would you database design look like, also your relationships in the models.

Can elaborate a bit? tnx

Mithridates started a new conversation Creating A Belongs To Many Relationship

I have a kinda unique situation here, I have 3 models: Degree, Student and Consultant.

There is a many to many rel between a student and a consultant. Also there is a many to many rel between degree and student.

I could have 2 pivot table for each one of those above relations, BUT what important here is, is that: a student in a specific degree can have 1 consultant. In other words creating 2 separate pivot table, doesn't give me the information which consultant is for what degree for a specific user.

I can think of 2 solutions here:

The first one is creating a pivot table with 3 foreign keys like:

student_id  |  degree_id  |  consultant_id

this way I could know who is the student's consultant for a specific degree.

But is this way, a standard way of architecturing database? Also, Should I create a Pivot model for this? What would be the code snippet look like?

The other approach I can think of is that create 2 separate pivot tables, and reference id of one pivot table in the other one. So this would look like something like: degree_student: student_id | degree_id consultant_student: student_id | consultant_id | **degree_student_id**

Again, is this a standard approach? Should I create a Pivot model for this?

For final discussion, I would embrace any other solution suggestions that are better(/standard).

28 Jul
1 year ago

Mithridates started a new conversation Should I Add Index To Every Primary Key

Sorry for naive question, When creating a migration is it recommended to add index to primary field like follows?

 $table->increments('id')->index();
08 Feb
2 years ago

Mithridates started a new conversation Testing Model Events

I'm writing a test, to assert a model event (like saved or updated is dispatched); Laravel has a method named $this->expectsModelEvents(User::class, 'updated'); Although I'm sure a model is updated this test returns error, adding Event::fake() didn't work either. Do you know how to get it work?

02 Feb
2 years ago

Mithridates started a new conversation Jobs Vs Listeners

I was listening this thread and couldn't sum it up. Both listeners and jobs can be queued(And have a similar signature) so what's the difference between them?

For example I need to send an email when a users register. Should I call a job directly in the controller or fire an event and that event should call appropriate listeners?

24 Jan
2 years ago

Mithridates started a new conversation Open Source Apps Built With Laravel

I'm looking for functional open source apps built with Laravel. The purpose behind this is to learn testing in action. Thanks beforehand.

Mithridates left a reply on How To Install Laravel 5.4

I thought I might be wrong about it, thanks anyways.

Mithridates left a reply on How To Install Laravel 5.4

@tomi tnx, now I can't install dingo/api with laravel 5.4 Any thoughts on that?

Mithridates started a new conversation How To Install Laravel 5.4

I tried to install 5.4 by trying install dev-master of larave/laravel but that version uses laravel 5.3. How to install laravel 5.4?

27 Dec
2 years ago

Mithridates left a reply on Tell Us What You Use In Production

I found (this)[https://github.com/cjbarber/ToolsOfTheTrade] on Github. This is a goldmine.

Mithridates started a new conversation Tell Us What You Use In Production

We are interested in 3rd party tools you are using (Either free or paid) in production environment along side your Laravel application.

Things like emailing tools, bug tracking tools, analytics tools, deployment tools, backup tools, etc.

Useful answers are those which give the product name,URL, and a very brief description.

For instance one answer for this question would be :

We are using:

  1. BugSnag for crash reporting
  2. Send Grid for our emailings. Listing them in lists would be nice.

We are NOT interested in: Javscript frameworks used, database technologies, etc.

Let's make a list useful to all. Thanks!

27 Oct
2 years ago
11 Oct
2 years ago

Mithridates left a reply on Scout / Elasticsearch - How Are People Defining Mappings?

@chrislentz Thanks for your answer, I had already concluded to do the exact way you do.

02 Oct
2 years ago

Mithridates left a reply on Scout / Elasticsearch - How Are People Defining Mappings?

@chrislentz have you found a way? I'm looking to have a analyzer for one of my models.

30 Sep
2 years ago

Mithridates started a new conversation Different Auth Controller For Api And Web

I'm having a delima and would appreciate if you help me out. Right now I'm using Laravel 5.3. it has it's own RegisteresController and LoginController. I'm providing a rest api through this app too. The api has it's own AuthController. Should all authentication related methods be moved to a single point and provide registration and login from there? The problem I have for separating them is that if I want to change a behaviour there should be changed in 3 places and if they are conjuncted in one file then it will be bloated will several behaviors with several outputs.

25 Sep
2 years ago

Mithridates left a reply on Upgrading From Laravel 5.1 To 5.3

@SaeedPrez have you tested it? how much does it take?

Mithridates started a new conversation Upgrading From Laravel 5.1 To 5.3

It seems really scary to me to upgrade my app. Should I first upgrade my app from 5.1 to 5.2 then 5.3 or you suggest create a new install of laravel and copy all files manually?

24 Sep
2 years ago

Mithridates left a reply on How To Upgrade To Laravel 5.3?

@bestmomo you mentioned in previous answers that One could just create a fresh install of laravel 5.3 and copy all files from 5.1 to 5.3. I'm just wondering how can I upgrade my 5.1 app to 5.3 with ease?

Mithridates left a reply on How To Upgrade To Laravel 5.3?

@bestmomo I have a Laravel 5.1 app, if I create a new 5.3 project and copy all my files, what will happen to my git files. can explain a bit how you would approach it?

17 Sep
2 years ago

Mithridates left a reply on Docker Series

no one planning to give a series?

15 Sep
2 years ago

Mithridates left a reply on Why Are Laravel And Algolia So Kind To Eachother

@poxin exactly, not self-hosted and free and above all open source matters to me. Can you give scout elastic provider's link?

Mithridates started a new conversation Why Are Laravel And Algolia So Kind To Eachother

I see algolia series started here before even introducing elastic search for laravel (Which I think should have been introduce first) Also laravel scout ships with algolia provider out of the box, not to be toled that algolia provides full text search for laravel docs. My question is that are any guys of laravel behind algolia or does algolia pays for laravel for introducing new customers?

06 Jul
3 years ago

Mithridates left a reply on Docker Series

Is this request going to hit any where? Docker, kubernets, and micro services are really rocking these days. Time to level up. continue +1 if you'd like too.

25 Jun
3 years ago

Mithridates started a new conversation What Should Be Unit Tested

I'm curious when following TDD what you test in your methods and what you ignore. I mean What should I test in order to make tests useful?

Mithridates left a reply on Issue On Composer Deploying A Laravel App On Production

@rtacadena can we see your database/seed file or database/factory?

21 Jun
3 years ago

Mithridates left a reply on How Is Egghead

@JeffreyWay oh gosh! Yeah you know I would love to ask some more advanced topics in js world. What I'm looking for is learning to use backbone, react, browserify and maybe angular in projects so that my laravel app doesn't worry about ui so much. By the way you are a great teacher I'm a member for about a year and I'm definitely satisfied. Just a bit complain though: Some series start at some point but you don't take we to depth any more, for example project flyer has almost been abandoned. also react has changed so much since that series was built and I didn't see much integration with laravel there. Tnx.

Mithridates left a reply on How Is Egghead

@willvincent do you think 200$ worth it?

Mithridates started a new conversation How Is Egghead

I'm considering purchasing a subscription from egghead. Do you recommend it? Also what are other resources I can learn more about js frameworks(paid or free). Tnx

20 Jun
3 years ago

Mithridates left a reply on In What Way Can I Combine Laravel And Angular To Vender Views

Too broad and vague question. Bot for a starting point I think you should be pointed to learn API development for your front end

Mithridates started a new conversation Complaining About Parallelism

First of all I really thank @JefferyWay for awesome tutorials. This complain does not mean I'm not satisfied with this site. I see some tutorials start at some point and then gets abounded without being finished. For example project flyer hasn't been updated for some months. also Some series like React has now been deprecated and there isn't any new series about it.(I know there is vue series and it's awesome) Also since I don't want to open another discuss I'd like to ask for a new series about run-time requirement libs like browserify or webpack.

15 Jun
3 years ago

Mithridates started a new conversation Can't Use Facades In Phpspec

I'm using laravel with phpspec. The problem I've encountered is that I can't use any facades in my tests. for example using using Auth::guest()->willReturn(false); throws an exception A facade root has not been set. I can use facades in my code surely and I've tested my imports.

14 Jun
3 years ago

Mithridates left a reply on Testdummy Custom Factories

hey @ SmoDav I'm talking about testdummy.

Mithridates started a new conversation Testdummy Custom Factories

I know you can create a custom type of a model like this: `` // A generic factory for users...

$factory('App\User', [ 'username' => $faker->username, 'password' => $faker->password, 'role' => 'member' ]);

// And a custom one for administrators

$factory('App\User', 'admin_user', [ 'username' => $faker->username, 'password' => $faker->password, 'role' => 'admin' ]); But what I want is that for a more specific factory, return a normal factory with overridden rule. So things don't get duplicate: like this: // A generic factory for users...

$factory('App\User', [ 'username' => $faker->username, 'password' => $faker->password, 'role' => 'member' ]);

// And a custom one for administrators

$factory('App\User', 'admin_user',function(){ return $factory->create("App\User",[ 'role' => 'admin']); `` How can I do this?

05 Jun
3 years ago

Mithridates started a new conversation Browserify Vs Webpack

I know browserify and webpack are relatively alternatives. Can Some one explain about strength and weaknesses of each library briefly?

29 May
3 years ago

Mithridates left a reply on Docker Series

anybody else?

28 May
3 years ago

Mithridates started a new conversation Docker Series

We have already reviewed vagrant for several times, I get hearing about docker and kubernetes. I would like to ask for a series for using docker and specifically kubernetes. +1 if you like to.

Mithridates started a new conversation Project Flyer

I've mentioned this before, so sorry if I'm repeating myself. I just wanna ask for project flyer's continue. Thanks

Mithridates left a reply on Assign Permission To View Certain Things On Building Nr.1 But Not Nr.2

@GKMelbo actually not! The only constraint the solution I mentioned you is that for a category in a building just one user can have the permission.

27 May
3 years ago

Mithridates left a reply on Assign Permission To View Certain Things On Building Nr.1 But Not Nr.2

@GKMelbo the soloution I mentioned you is almost correct, you need to store category_id and user_id for a building. Unfortunately, I haven't come across to a problem needing 3 foreign keys in one pivot table.

26 May
3 years ago

Mithridates left a reply on Assign Permission To View Certain Things On Building Nr.1 But Not Nr.2

@GKMelbo hey, answering questions doesn't bother me :) But if you would like take suggestion from me, I would recommend you take a series in laravel first, After you get your feet wet, start learning by doing projects. Again if you have any other questions just mention me. For this problem you have, I think even if I solve the whole problem for you, you wouldn't learn so much, so I recommend you to do it yourself. Cheers :)

Mithridates left a reply on Assign Permission To View Certain Things On Building Nr.1 But Not Nr.2

@GKMelbo seems like you're not familiar so much with larvel, are you?

23 May
3 years ago

Mithridates started a new conversation Multiple Projets On One Vagrant Box

I have two projects in these directories:E:\projects\deep-learning and E:\projects\computer-vision. What I want to do is that both of them to be run on one box (like trusty.) How to configure vagrantfile to both use the same box.

Mithridates left a reply on Assign Permission To View Certain Things On Building Nr.1 But Not Nr.2

@GKMelbo yeah I didn't create $categoryIds since that was easy. In order to find category ids you need to get ids from checkbox then find them in your category model like this:

$categoryIds=Category::where("id", ' = ' ,$id)->get('id');

Then pass it to the code I provided above.

22 May
3 years ago

Mithridates left a reply on Assign Permission To View Certain Things On Building Nr.1 But Not Nr.2

Hey @GKMelbo sorry for late reply, The problem now is how I save the checked categories into the pivot table? just in your updateBuilding method you can assign categories to a building just like this: The solution below assumes that you have defined relationships in your models correctly.

$categories=Category::where('id','=',$categoryIds)->get(); $building->categories()->sync($categories);

Then you need to give a user permission to view certain categories on every building the user should have access to. To do this you have to do something like this: foreach($category in $categories) { $building->whereCategory($category->getKey)->user()->sync($user->getKey()); $building->save(); }

I think that solves almost all of your problem. mention me if you get any problem. also it's good to check this link. http://stackoverflow.com/questions/24702640/laravel-save-update-many-to-many-relationship

15 May
3 years ago

Mithridates left a reply on Assign Permission To View Certain Things On Building Nr.1 But Not Nr.2

hey @GKMelbo first of all building_category_user is really a redundant table name for me so I would go with building_category table name. I try here to explain a bit of logic of your app as far as I have figured your business logic's requirements out. I assume that a building can have several categories and a specific user can have to one category of a building but not the other category of that same building.(Right?) your first question: How do I automatically assign all of the categories to every new building? You can create model listeners for this. That is, when a model(say, a Building) is created, The event listener is disposed and pivot table records are added to the pivot table.

I want to display the buildings a user has access to in my editUser view I can query models based on pivot table like this: the eloquent query builder will look sth like this to me: $buildings=Building::with(array('users','categories'),function ($q) use ($user){ $q->wherePivot('user_id',$user->getKey()); })->get(); the $user is the user you wanna get the buildings she manages. note that also I eager loaded the relationships(user and categories) too. Then you can pass it to a view.

mention me if you got any problems.

13 May
3 years ago

Mithridates left a reply on Free SSL?

@nickwest you suggest me to pay for SSL cert if my app is ecomerce. My question is what paid certs offer which Let's encrypt does not?