mohammad6006

mohammad6006

Member Since 3 Years Ago

Experience Points 1,460
Experience Level 1

3,540 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 6
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.

04 Sep
10 months ago

mohammad6006 started a new conversation Laravel Cache Index With Multiple Keys

I need to cache item selected by users and get items by users and categories seprated

user selected item key:user1 value:[category1:item1 , category1:item2, category3:item5 ,...]

how can I store and get selected items by category

for example category1 items => [item1,item2]

08 Aug
11 months ago

mohammad6006 started a new conversation Apache To Nginx

I need to define rule in my nginx server when I go site.com/play/gamename

it have css and js file and load url is site.com/play/gamename/script.js but script.js is in site.com/uploads/games/gamename/script.js and I want to load from this address

how can define this rule in nginx

I had this in my htaccess in previous apache server

    RewriteCond %{REQUEST_URI} \.(jpg|png|css|js|appcache|xml|ogg|m4a)$
    RewriteRule ^play/(.+) username/public/uploads/games/ [L]
21 Dec
1 year ago

mohammad6006 started a new conversation Dns In Forge

because of domain panel I couldnt set A record to one of my domains and I have to set name server like ns1.domain.com on this domain

I have another domain on my forge server

how can I use domain on my server to create dns and set this dns to my other domain like ns1.domain.com

01 Nov
1 year ago

mohammad6006 started a new conversation Delivery Price Solution

hey guys what is the best way to calculate delivery price and cost for online food system? delivery price as distance of user and restaurant

making polygon on map to divide city to multiple zone and set price to each zones or calculate distance of user and shop?

which one is better? let me know if you have other suggestion or api or laravel package for this job thank you

15 Jun
2 years ago

mohammad6006 started a new conversation Insect Sub Query

I want to filter my products page there is a filter table and filter_product table with many to many relation with product table

my filters table is like this: -id -parent_id -name

//filters with same parent_id shoud be OR in filtering and the result of that shoud be AND with different parent id filtering

filter_product -product_id -filter_id

for example I want to filter product by color and size

color: -red -green

size: -large -xlarge

(red OR green ) AND (large OR xlarg) how can do that?

its the code that I write And I want to know how can i get insect result of two sub query

Product::with('filters)
->whereHas('filters' , function ($query){

$query->whereIn('filter_id',$array1);
INSECT
$query->whereIn('filter_id',$array2);
}
05 May
2 years ago

mohammad6006 started a new conversation Filter Search Requests

I have a page to show resluts of search and some options to filter search results

I decide to use vuejs to show products and filters but I need to have url options for filters

for exaple if user filter results by date so this filter change url like this : url#sort=date

first question: Do I need to use Vue-router? or I can set filters to url without using vue-router?

2: which way is better? getting search result from api with axios and set filter client side (I mean witouht sending request)

OR

set filters via sending new request to api to get new results

thanks

15 Dec
3 years ago

mohammad6006 started a new conversation Which Relation Is Correct?

because of multi language site I created 6 table , product , category , zone , slug , language and translate

there is many to may relation between slug and language so translation of each slug store in translate table

but I don't know how can I define a relation to store all slugs of product , zone and category table in slug table

28 Nov
3 years ago

mohammad6006 started a new conversation A Laravel Application And Multiple Server

I created multi language laravel site

there are russian , arabic and english translation and different template for each language

now I want to store this site in different servers and country of that translation

for example if visitor is from russia : site load from russian server

or if visitors is from arab countries then site load from specific server

how is it possible? and what should i do?

25 Nov
3 years ago

mohammad6006 started a new conversation Laravel 5.1 Snippets

I installed laravel 5 snippets for my sublime text 2 (https://github.com/Lykegenes/laravel-5-snippets)

but its not like laravel 5.1

example : Route::get is Route->get....

could you help me to find laravel 5.1 snippets for sublime text 2?

23 Nov
3 years ago

mohammad6006 left a reply on How To Add Plugin In Cpanel Host Without Composer?

@JoeDawson
yes I do, Do you mean I have to install composer? Is not another way?

mohammad6006 started a new conversation How To Add Plugin In Cpanel Host Without Composer?

I created a laravel application in my localhost via composer and upload it to my cpanel host

now I need to add new plugin but I dont have composer in my cpanel

what should I do?

19 Oct
3 years ago

mohammad6006 started a new conversation Add And Edit In Same Form

How can I define a same form for Add and Edit and store theme

I know there is Form::model but I don't use Form fecade

16 Oct
3 years ago

mohammad6006 left a reply on Use Controllers Mthods In Base Controller

@JesusAlvSoto I know that but it was an example I have another methods

my question is that How can I include controler or call method of controller in base controller?

mohammad6006 left a reply on Use Controllers Mthods In Base Controller

@pmall

zone.blade.php

htmlcodes
$zonelist , $coutrylist , $portlists
endhtmlcodes

zoneController:

index()
{ 
$zonelist = Zone::All();
return $zonelist;
}

portController:

index()
{ 
$portlist = Port::All();
return $portlist;
}

countryController:

index()
{ 
$countrylist= Country::All();
return $countrylist;
}

now how can I send these to one view page same time?

mohammad6006 left a reply on Use Controllers Mthods In Base Controller

@pmall

but how can I do that when I call one controller in route

for example Route::get('zone',zoneController@index);

and index method return one array : zonelist to view(zone.blade) , but I define 3 variable in zone.blade

mohammad6006 left a reply on Use Controllers Mthods In Base Controller

@pmall , @bestmomo

for example I have 3 controllers

zoneController , countryController and portController

and there are index method in per controllers that show datas like $zonelist = Zone::All(); and return $zonelist; I want to show index methods of these controllers in one blade view for example main.blade.php

so I create mainController and get datas of All other controllers in this controller and return to view

mohammad6006 started a new conversation Use Controllers Mthods In Base Controller

how can I use all controllers method in a base controller ?

I have oneController , secoundController and thirdController

I need to use methods of these controllers in baseController

what should I do?

12 Oct
3 years ago

mohammad6006 started a new conversation Model To Json

I use https://github.com/yajra/laravel-datatables

but it send request and query to database for each action

how can I use json instead of query request

is there any plugin to get create a json file from datas which get by model?

07 Oct
3 years ago

mohammad6006 started a new conversation Many To Many And Polymorphic Relation

I want to show field seprated by usergroup or category so I create this 4 table

usergroup
    id
    name
    
category
    id
    name
    
fieldgroup
    id
    name
    
field
    id
    name

there are many to many relation between field and fieldgroup

field_fieldgroup
    fieldgroup_id
    field_id

but fieldgroup will show by Polymorphic relation with category or usergroup

So I create fieldgroupable table

fieldgroupable
    fieldgroup_id
    fieldgroupable_id
    fieldgroup_type

and type is category or usergroup model

But Im not sure this is right way or wrong way

30 Sep
3 years ago

mohammad6006 left a reply on Extra Column Or New Table

@frezno , @unitedworx I need to have a field manager and add new fields from admin panel because I don't know how many field is needed in future

29 Sep
3 years ago

mohammad6006 started a new conversation Extra Column Or New Table

I installed bestmomo/scafold and use Auth system

now I want to delvelope user table with extra field but maybe there would be more than 20 field which user should fill them is it better to crate new table for that or add column for each field in user table

is there any git for such kind of thing?

19 Sep
3 years ago

mohammad6006 left a reply on Insert And Attach Tag To The Post In Same Time

@sid405 but I didnt insert any tags on tag table before and I want to insert tag and attach it to post in same time

on the other hand

$request->input('tag') is name of a tag and query want to insert tag name instead of tag id

your query show this error : insert into posts_tag (created_at, posts_id, tag_id, updated_at) values (2015-09-19 08:09:38, 35, tagname, 2015-09-19 08:09:38))'

tagname should be tag_id

18 Sep
3 years ago

mohammad6006 started a new conversation Insert And Attach Tag To The Post In Same Time

I'm beginner in laravel. I created a form with title, body and tag input and there are 3 tables: posts, tags and post_tag.

Now I use this function to add new tags and attach them to the post

postcontroller.php public function store(Request $request) { $input = $request->all(); //get inputs value

    $tag = $input['tag'];
    $tagdone = Tag::create(['name'=>$tag]);
    $tagid = $tagdone->id; //insert tag to tags table

    $posts = Posts::create($input); //insert posts table
    $postid = $posts->id; 

    Posts::find($postid)->tags()->attach($tagid); //attach tag to the post
}

Actually 3 action in same time. But I think there are better ways than this one, so I'd like some feedback on what I've written.