sami2500

Experience

890

0 Best Reply Awards

  • Member Since 2 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

14th August, 2018

sami2500 started a new conversation I Want To Fetch The Name Of Each One Of Them • 2 days ago

code controller:

    $dc=array();
    for($i=1;$i<=10;$i++)
    {
      $s = substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyz", 5)), 0, 5);
      $dc[] = myUser::create(['name' => $s, 'email' => $s.'@email.com']);
    }
dd($dc);

output

array:10 [▼
  0 => myUser {#207 ▼
    #label: "myUser"
    #fillable: array:2 [▶]
    #connection: null
    #table: null
    #primaryKey: "id"
    #keyType: "int"
    +incrementing: true
    #with: []
    #withCount: []
    #perPage: 15
    +exists: true
    +wasRecentlyCreated: true
    #attributes: array:5 [▼
      "name" => "7z7ax"
      "email" => "[email protected]"
      "updated_at" => "2018-08-14 07:26:25"
      "created_at" => "2018-08-14 07:26:25"
      "id" => 306
    ]
    #original: array:5 [▶]
    #changes: []
    #casts: []
    #dates: []
    #dateFormat: null
    #appends: []
    #dispatchesEvents: []
    #observables: []
    #relations: []
    #touches: []
    +timestamps: true
    #hidden: []
    #visible: []
    #guarded: array:1 [▶]
  }
  1 => myUser {#205 ▶}
  2 => myUser {#206 ▶}
  3 => myUser {#209 ▶}
  4 => myUser {#210 ▶}
  5 => myUser {#211 ▶}
  6 => myUser {#216 ▶}
  7 => myUser {#217 ▶}
  8 => myUser {#218 ▶}
  9 => myUser {#219 ▶}
]

7th August, 2018

sami2500 left a reply on Connect Laravel With Neo4j • 1 week ago

@Snapey Laravel's relationship with neo4j sample code

sami2500 left a reply on Connect Laravel With Neo4j • 1 week ago

6th August, 2018

sami2500 started a new conversation Connect Laravel With Neo4j • 1 week ago

How to connect laravel with neo4j And a simple multi-queue scroll in laravel What is it?

20th July, 2018

sami2500 started a new conversation Upload File • 3 weeks ago

I am registering with file uploading Now the user may not upload the file during this registration I want to make no mistakes I will not be logged in the database when I upload the file

7th July, 2018

sami2500 left a reply on How To Fix This Error؟ • 1 month ago

type collation= utf8mb4_unicode_ci

4th July, 2018

sami2500 started a new conversation Get The File Size Uploaded • 1 month ago

Use the following command

$sizefile=$request->file('userfile')->getClientSize();

But the error follows

SplFileInfo::getSize(): stat failed for C:\Users\rojan\AppData\Local\Temp\phpB44.tmp

2nd July, 2018

sami2500 left a reply on Larvel Function Pluck • 1 month ago

@Snapey How to display inside the show؟

sami2500 started a new conversation Larvel Function Pluck • 1 month ago

You can use the pluck command to input more than three values, such as the following example

  $find = Roleuser::where('user_id', $id)->pluck('user_id','role_id','id');

24th June, 2018

sami2500 left a reply on Update Check Box • 1 month ago

How to get in the controller

   <input type="checkbox" name="name[]">

@Dunsti @codenex @WebKenth

23rd June, 2018

sami2500 left a reply on Poll Laravel • 1 month ago

@bobbybouwmann Have some special settings? Because I do not do anything Do you have a file? Send me

sami2500 started a new conversation Poll Laravel • 1 month ago

Hello I want to make a poll

Is there a plugin that's fine? You worked with it yourself

sami2500 left a reply on Convert A String To A Integer • 1 month ago

@joshuafranks code:

      $dt = Carbon::now()->toDateString();
      $ly=Alert::where('ext_date','=',$dt)->pluck('msg');
var_dump($dt);

output

string(10) "2018-06-23"

sami2500 started a new conversation How To Fix This Error؟ • 1 month ago

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xD8\xA2\xD8\xB2\xD8\xA7...' for column 'msg' at row 1 (SQL: insert into `alerts` (`msg`, `ext_date`, `updated_at`, `created_at`) values (آزادی از جمله تجملاتی است که هرکسی توان کسب آن را ندارد., 2018-07-04, 2018-06-23 05:20:21, 2018-06-23 05:20:21))

16th June, 2018

sami2500 started a new conversation How To Receive Data With A Checkbox In Laravel • 2 months ago

Hello I have multiple checkboxes for each user I want to put a value in the database when clicking on the checkbox and if the tick is removed, the value will be zeroed in the database. How should I check it?

14th June, 2018

sami2500 started a new conversation Convert Date Persian To English • 2 months ago

Only converts a year to English Do not turn day and month

public function store(Request $request){
 
        request()->validate([
            'matn' => 'required',
            'datex' => 'required'
       ]);
        $arabic = ['٩', '٨', '٧', '٦', '٥', '٤', '٣', '٢', '١','٠'];
        $num = range(0, 9);
        $convert = str_replace($persian, $num, $request->datex);
        list($year, $month, $day) = explode('-', $convert);


       $user=Post::create([
            'menu_id'=> $request->name,
            'user_id'=>auth()->user()->id,
            'body'=>$request->matn,
            'Expiration_date' =>Verta::getGregorian($year, $month, $day)
       ]);

sami2500 started a new conversation Convert A String To A Integer • 2 months ago

The input date value is displayed as follows "2014-10-20" I want to be numeric so that the converting function can be registered in the table 2014-10-20

sami2500 started a new conversation Convert Persian Date To Milad Data • 2 months ago

Convert farsi date to milad Inside the database I want to convert the date of the entry into the milad in the database

sami2500 left a reply on Delete Post Automatically By Date • 2 months ago

What code do I write right for you? @Snapey

sami2500 started a new conversation Delete Post Automatically By Date • 2 months ago

I've added an additional field for my post I want to delete posts from the database when the expiration date is equal to today's date I wrote the following Is that okay?

        $namess=Post::where('Expiration_date','=',Carbon::now())->delete();
        $namess=Post::where('user_id', auth()->user()->id)->paginate(4);
        return view('user.post.maneger',compact('namess'));

12th June, 2018

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Cronix Just edit the role

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey null return

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey Yes - I have information in any database

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey where is the problem from?

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey This is my table

user

id----name---username

role

id-----types

roleuser

id---user_id---role_id----active

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey I wrote the following model user

public function roleuser()
    {
        return $this->hasOne(Roleuser::class);
    }

model roleuser

    public function user()
    {
        return $this->belongsTo(User::class);
    }

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@rin4ik error:

Trying to get property of non-object 

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey problem : in view

$find->user->name

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey where is the problem from

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

error: Trying to get property of non-object line: $find->user->name

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey As follows

protected $table = 'user';

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey This is my table user id----name---username role id-----types roleuser id---user_id---role_id----active The error below Trying to get property of non object

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey I wrote the following model user

public function roleuser()
    {
        return $this->hasOne(Roleuser::class);
    }

model roleuser

    public function user()
    {
        return $this->belongsTo(User::class);//once paper for once a user
    }

sami2500 left a reply on Trying To Get Property Of Non Object • 2 months ago

@Snapey How to write this relationship in the model?

sami2500 started a new conversation Trying To Get Property Of Non Object • 2 months ago

controller:

  public function edit($id){
        $find=Roleuser::find($id);
        return view('admin.role.roleupdate',compact('find'));
    }

view:

$dd=$find->user_id;
  $pos=DB::table('users')->where('id','=',$dd)->pluck('name');
Edit Your Profile
Update

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