omarsow94

Experience

2,610

0 Best Reply Awards

  • Member Since 9 Months Ago
  • 3 Lessons Completed
  • 0 Favorites

11th February, 2018

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 2 months ago

@Snapey thank you . i delete laravel.log et retry . It's work fine now, i had syntax error in my UserFactory class .

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 2 months ago

I know when i try vendor/phpunit/phpunit/phpunit command line .

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 2 months ago

Yes @Snapey and the last error is not about testGetComments function .

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 2 months ago

in

$post = factory(Post::class)->create(); from

public function testGetComments() {
        $post = factory(Post::class)->create();
        $comment = factory(Comment::class)->create(
          [ 'commentable_type' => 'Post', 'commentable_id' => $post->id ]
        );
        $comment2 = factory(Comment::class)->create(
          [ 'commentable_type' => 'Post', 'commentable_id' => $post->id ]
        );
        $comment3 = factory(Comment::class)->create(
          [ 'commentable_type' => 'Post', 'commentable_id' => $post->id ]
        );

        $response = $this->call('GET', '/comments', ['type' => 'Post', 'id' => $post->id]);
        $comments = json_decode($response->getContent());
        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals(3, count($comments));
    }

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 2 months ago

in

$post = factory(Post::class)->create();

omarsow94 started a new conversation Teste • 2 months ago

teste

omarsow94 left a reply on Contact Us Form (sending Email) Laravel 5 • 2 months ago

teste

30th January, 2018

omarsow94 left a reply on Inner Join In Eloquent • 2 months ago

In your Manufacturer model , you have function like that

public function products{
    return belongsTo('App\Manufacturer');
}

?

omarsow94 started a new conversation URL Shortened - Waavi/url-shortener • 2 months ago

How to use Waavi/ur-shortener i have this error UrlShortened not found . I run all of command line https://github.com/Waavi/url-shortener but nothing.

27th January, 2018

omarsow94 left a reply on Error 401 • 2 months ago

@jcmargentina i add "s" but the error still. I try to check if all response are send in my console (Network / XHR) and i have Status Code:401 Unauthorized

omarsow94 left a reply on Error 401 • 2 months ago

omarsow94 started a new conversation Error 401 • 2 months ago

I have app.js:23492 GET http://127.0.0.1:8000/api/conversations 401 (Unauthorized) trying to get response (conversations in my case) . Someone can explain me please ?

My App\Http\Controllers\Api\ConversationsController.php file

<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Repositories\ConversationsRepository;
use Illuminate\Http\Request;

class ConversationsController extends Controller
{
    private $conversationRepository;

    public function __contruct(ConversationsRepository $conversationRepository){
        $this->conversationRepository = $conversationRepository;
    }
    public function index(Request $request){
        return response()
          ->json([
              'conversations' => $this->conversationRepository->getConversations($request->user()->id)
          ]);
    }
}

19th January, 2018

omarsow94 left a reply on Repositories • 3 months ago

I work fine now , i don't know exactly why, i just replace ConversationRepository by ConversationsRepository ( add s to Conversation) .

omarsow94 left a reply on Repositories • 3 months ago

It going ! I replace ConversationRepository by ConversationsRepository ( add s to Conversation) . Now i have this error : Trying to get property of non-object ( r ) on

  public function index()
    {
        return view('conversations.index',[
            'users' => $this->r->getConversations($this->auth->user()->id)
        ]);
    }

from my controller

<?php

namespace App\Http\Controllers;

use App\Repositories\ConversationsRepository;
use Illuminate\Http\Request;
use Illuminate\Auth\AuthManager;
use Illuminate\Support\Facades\Auth;
use App\User;


class ConversationsController extends Controller
{
    private $r;
    private $auth;

    public function __construct(ConversationsRepository $conversationRepository, AuthManager $auth)
    {
        $this->r = $conversationRepository;
        $this->auth = $auth;
    }
    public function index()
    {
        return view('conversations.index',[
            'users' => $this->r->getConversations($this->auth->user()->id)
        ]);
    }

    public function show(User $user)
    {
        return view('conversations.show',[
            'users' => $this->r->getConversations($this->auth->user()->id),
            'user' => $user
        ]);
    }

    public function store(User $user, Request $request)
    {
        $this->r-createMessage(
            $request->get('content'),
            $request->auth->user()->id,
            $user->id
        );
    }


}

omarsow94 left a reply on Repositories • 3 months ago

@deepu07 result :

>>> App\Repositories\ConversationRepository::getConversations(1);
PHP Deprecated:  Non-static method App\Repositories\ConversationRepository::getConversations() should not be called statically on line 1

18th January, 2018

omarsow94 left a reply on Repositories • 3 months ago

@MaverickChan i create a file locally , Ok @deepu07 i try stay touch

omarsow94 left a reply on Repositories • 3 months ago

No the repository . In Repositories folder

omarsow94 left a reply on Repositories • 3 months ago

Same error @deepu07 , i don't understand why Class App\Http\... doesn't exist , Http ? it's a Repository

omarsow94 left a reply on Repositories • 3 months ago

same error @deepu07 :

Class App\Repositories\cRepository does not exist

omarsow94 left a reply on Repositories • 3 months ago

I still have error, @jcmargentina when i replace my contruct param with ```(\App\Repositories\ConversationRepository $conversationRepository, AuthManager $auth) i have this error :

Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING)

@jbloomstrom my App\Repositories\ConversationRepository file

<?php

namespace App\Repositories;

use Illuminate\Database\Eloquent\Model;
use App\User;
use App\Message;
use Carbon\Carbon;

class ConversationRepository
{

      private $user;
      private $message;

      public function __construct(User $user, Message $message)
      {
          $this->user = $user;
          $this->message = $message;
      }

      public function getConversations(int $userId) {
          $this->user->newQuery()
            ->select('name', 'id')
            ->where('id','!=', $userId)
            ->get();
      }

      public function createMessage(string $content, int $from, int $to){
          $this->message->newQuery()->create([
              'content' => $content;
              'from_id' => $from,
              'to_id' => $to,
              'created_at' => Carbon::now();
          ]);
      }

}

17th January, 2018

omarsow94 left a reply on Repositories • 3 months ago

I use Linux , i should put 777 ? (chmod) @MaverickChan

omarsow94 left a reply on Repositories • 3 months ago

conversation @MaverickChan , i have ConversationsController with 's' and ConversationRepository without 's'

omarsow94 left a reply on Repositories • 3 months ago

@jbloomstrom the latest message in laravel.log file is :

[2018-01-18 01:07:18] local.ERROR: Class App\Http\Controllers\ConversationRepository does not exist {"exception":"[object] (ReflectionException(code: 0): Class App\Http\Controllers\ConversationRepository does not exist at /var/www/html/VueJS/chat/vendor/laravel/framework/src/Illuminate/Container/Container.php:811)
[stacktrace]

omarsow94 left a reply on Repositories • 3 months ago

the whole controller :

<?php

namespace App\Http\Controllers;

use App\Repositories\ConversationRepository;
use Illuminate\Http\Request;
use Illuminate\Auth\AuthManager;
use Illuminate\Support\Facades\Auth;
use App\User;


class ConversationsController extends Controller
{
    private $r;
    private $auth;

    public function __construct(ConversationRepository $conversationRepository, AuthManager $auth)
    {
        $this->r = $conversationRepository;
        $this->auth = $auth;
    }
    public function index()
    {
        return view('conversations.index',[
            'users' => $this->r->getConversations($this->auth->user()->id)
        ]);
    }

    public function show(User $user)
    {
        return view('conversations.show',[
            'users' => $this->r->getConversations($this->auth->user()->id),
            'user' => $user
        ]);
    }

    public function store(User $user, Request $request)
    {
        $this->r-createMessage(
            $request->get('content'),
            $request->auth->user()->id,
            $user->id
        );
    }


}

@jbloomstrom

omarsow94 left a reply on Repositories • 3 months ago

I still have the same error after running the commands lines @impbob

Class App\Http\Controllers\ConversationRepository does not exist

omarsow94 left a reply on Repositories • 3 months ago

I change

use App\Repositories\ConversationRepository;

to

use App\Repositories\test;

so normally i should have this message error

Class App\Http\Controllers\test does not exist

but not i have the same message

Class App\Http\Controllers\ConversationRepository does not exist

omarsow94 left a reply on Repositories • 3 months ago

Already done, but the message error still @bestmomo

omarsow94 started a new conversation Repositories • 3 months ago

I have Class App\Repositories\ConversationRepository does not exist error but in my controller i put : use App\Repositories\ConversationRepository; and in my Repositories\ConversationRepository i put namespace App\Repositories; . I think everythink is OK but this error message still

15th January, 2018

omarsow94 left a reply on Send Email (password Reset) • 3 months ago

Thank you @Snapey it's working with https://postmarkapp.com/

omarsow94 left a reply on Send Email (password Reset) • 3 months ago

@bobbybouwmann it's done but 0 answer

omarsow94 started a new conversation Send Email (password Reset) • 3 months ago

Where can i find this information in OVH ?

MAIL_DRIVER=?
MAIL_HOST=?
MAIL_PORT=?
MAIL_USERNAME=?
MAIL_PASSWORD=?
MAIL_ENCRYPTION=?

omarsow94 left a reply on Connection Could Not Be Established With Host Smtp.gmail.com • 3 months ago

We have emailed you the password reset link! But i dont received mail . Someone can help me ?

10th January, 2018

omarsow94 left a reply on Connection Could Not Be Established With Host Smtp.gmail.com • 3 months ago

mailtrap.io work on production ? @Vijay

omarsow94 left a reply on Connection Could Not Be Established With Host Smtp.gmail.com • 3 months ago

still, i don't received mail

omarsow94 left a reply on Connection Could Not Be Established With Host Smtp.gmail.com • 3 months ago

It's done , i check but nothing @Vijay

omarsow94 left a reply on Connection Could Not Be Established With Host Smtp.gmail.com • 3 months ago

Cool, We have e-mailed your password reset link! but i don't received email @Vijay

omarsow94 started a new conversation Connection Could Not Be Established With Host Smtp.gmail.com • 3 months ago

Every informations about my gmail account are OK, but the error still

config/mail.php

<?php

return [



    'driver' => env('MAIL_DRIVER', 'smtp'),

 

    'host' => env('MAIL_HOST', 'smtp.gmail.com'),

  

    'port' => env('MAIL_PORT', 587),


    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', '[email protected]'),
    ],

   

    'encryption' => env('MAIL_ENCRYPTION', 'tls'),

    

    'username' => env('MAIL_USERNAME'),

    'password' => env('MAIL_PASSWORD'),

   
    'sendmail' => '/usr/sbin/sendmail -bs',

    

    'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],

];

AND my .env file

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=tls

omarsow94 left a reply on How To Deploy Laravel On OVH Perso • 3 months ago

@MickaelAm everythink is ok now , exactly hey are hosted on different datacenters of them. it's work .

Now i dont find MAIL_DRIVE , MAIL_HOST in OVH panel (for contact page) , can you help me ?

9th January, 2018

omarsow94 left a reply on How To Fix ' SQLSTATE[HY000] [2002] Connection Refused' Error. • 3 months ago

Yes @tisuchi it was database permission , now it's work . Thank you all @tisuchi , @Vijay

omarsow94 left a reply on How To Fix ' SQLSTATE[HY000] [2002] Connection Refused' Error. • 3 months ago

Yes i know , i change all values for the truth. In local , it's work but in production not

omarsow94 left a reply on How To Fix ' SQLSTATE[HY000] [2002] Connection Refused' Error. • 3 months ago

right values

DB_CONNECTION=mysql
DB_HOST=mydomaine.mysql.db
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=mydbname
DB_PASSWORD=secret

@tisuchi

omarsow94 started a new conversation How To Deploy Laravel On OVH Perso • 3 months ago

I have

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `articles` where (`visible` = 1 and `check` = 1) order by `created_at` desc)

error, but i put the good database information , i despair, someone can help me . .env file :

APP_NAME=AfricanAgora
APP_ENV=production
APP_KEY=base64:/Mg66qNT9Xx8ckgZJayB+ubpOyzQC1yfh9/oND3CfY8=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://mydomaine.com

DB_CONNECTION=mysql
DB_HOST=mydomaine.mysql.db
DB_PORT=3306
DB_DATABASE=mydatabasename
DB_USERNAME=mydatabaseusername
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=africanagora.com
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=ftp.cluster026.hosting.ovh.net
MAIL_PORT=2525
MAIL_USERNAME=africanawh
MAIL_PASSWORD=VgJ67ZSJ3N6j
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

NOCAPTCHA_SECRET=6LddnDoUAAAAAF2n8iFWdrUfEr1AOj0uSaW46qlJ
NOCAPTCHA_SITEKEY=6LddnDoUAAAAAB88KryZ5I-eXQ3Fq0zpXOj-6pWf

omarsow94 started a new conversation How To Fix ' SQLSTATE[HY000] [2002] Connection Refused' Error. • 3 months ago

I put the good informations but the message error still ; In local it's work but not in production

omarsow94 left a reply on SQLSTATE[HY000] [2002] Connection Refused • 3 months ago

i have the good informations

omarsow94 started a new conversation SQLSTATE[HY000] [2002] Connection Refused • 3 months ago

I have SQLSTATE[HY000] [2002] Connection refused error but informations in my .env file are good .

8th January, 2018

omarsow94 left a reply on .htaccess Redirection • 3 months ago

i don't have errors in local

omarsow94 left a reply on Deploy With FTP • 3 months ago

The "public/storage" directory already exists.

after running this commande line php artisan storage:link @ejdelmonico

omarsow94 left a reply on .htaccess Redirection • 3 months ago

and one of errors is :

[2017-12-20 22:31:59] local.ERROR: Not enough arguments (missing: "name"). {"exception":"[object] (Symfony\Component\Console\Exception\RuntimeException(code: 0): Not enough arguments (missing: \"name\"). at /var/www/html/thiam/akhmedou/vendor/symfony/console/Input/Input.php:76)

omarsow94 left a reply on .htaccess Redirection • 3 months ago

Yes i have laravel.log in Storage/logs

Edit Your Profile
Update

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