omarsow94

Experience

2,180

0 Best Reply Awards

  • Member Since 6 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

19th January, 2018

omarsow94 left a reply on Repositories • 2 days 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 • 2 days 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 • 2 days 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 days ago

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

omarsow94 left a reply on Repositories • 3 days ago

No the repository . In Repositories folder

omarsow94 left a reply on Repositories • 3 days 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 days ago

same error @deepu07 :

Class App\Repositories\cRepository does not exist

omarsow94 left a reply on Repositories • 3 days 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 • 4 days ago

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

omarsow94 left a reply on Repositories • 4 days ago

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

omarsow94 left a reply on Repositories • 4 days 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 • 4 days 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 • 4 days 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 • 4 days 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 • 4 days ago

Already done, but the message error still @bestmomo

omarsow94 started a new conversation Repositories • 4 days 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) • 6 days ago

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

omarsow94 left a reply on Send Email (password Reset) • 6 days ago

@bobbybouwmann it's done but 0 answer

omarsow94 started a new conversation Send Email (password Reset) • 6 days 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 • 6 days 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 • 1 week ago

mailtrap.io work on production ? @Vijay

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

still, i don't received mail

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

It's done , i check but nothing @Vijay

omarsow94 left a reply on Connection Could Not Be Established With Host Smtp.gmail.com • 1 week 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 • 1 week 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 • 1 week 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. • 1 week 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. • 1 week 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. • 1 week 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 • 1 week 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. • 1 week 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 • 1 week ago

i have the good informations

omarsow94 started a new conversation SQLSTATE[HY000] [2002] Connection Refused • 1 week 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 • 1 week ago

i don't have errors in local

omarsow94 left a reply on Deploy With FTP • 1 week ago

The "public/storage" directory already exists.

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

omarsow94 left a reply on .htaccess Redirection • 1 week 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 • 1 week ago

Yes i have laravel.log in Storage/logs

omarsow94 left a reply on .htaccess Redirection • 1 week ago

My php version is PHP 7.0.22,

Laravel.log where ? in my laravel app home ?

omarsow94 left a reply on .htaccess Redirection • 1 week ago

Yes it's done but i have this error message:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

omarsow94 left a reply on .htaccess Redirection • 1 week ago

So in fileZilla 705 permission for forders and 604 for files .

omarsow94 left a reply on Deploy With FTP • 1 week ago

my .htaccess file :

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ public_html/africanagora/index.php [L]

</IfModule>

The permissions for public/storage and for storage/ are too 755 or rwxr-xr-x. @ejdelmonico

omarsow94 left a reply on Delete Post Safely • 2 weeks ago

Yup @Snapey so sorry it wasn't at all difficult, I was not too focused , sorry again

7th January, 2018

omarsow94 left a reply on Deploy With FTP • 2 weeks ago

Excuse my english @ejdelmonico , i want to say : I deploy my laravel ( on OVH ) but i have

Forbidden
You don't have permission to access / on this server.

message trying to connect on my website

omarsow94 left a reply on Delete Post Safely • 2 weeks ago

I agree I have trouble deploying with FTP (on OVH) at the same time it stressed me LOL

omarsow94 left a reply on Delete Post Safely • 2 weeks ago

Oh yeah I had not thought about that, Thank you very much

omarsow94 left a reply on Delete Post Safely • 2 weeks ago

exactly @tykus , but my function work ?

public function destroy($id)
     {
          $article = Article::find($id);

          $article->comments()->delete();

          $article->delete();
}

omarsow94 left a reply on Delete Post Safely • 2 weeks ago

akhmedou is not a table , it's the database name . @tykus

omarsow94 started a new conversation Deploy With FTP • 2 weeks ago

I have

Forbidden
You don't have permission to access / on this server.

I don't know if it's the .htaccess or permissions in public/storage folder ?

omarsow94 left a reply on Delete Post Safely • 2 weeks ago

I don't have a user_ip field in my articles migration

public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->string('title');
            $table->string('slug')->unique();
            $table->text('body');
            $table->integer('visible');
            $table->integer('check')->default(0);
            $table->integer('view_counter')->default(0);
            $table->string('cover')->default(URL::to('/').'/uploads/covers/default.jpg');
            $table->timestamps();
            $table->foreign('user_id')->references('id')
               ->on('users')->onDelete('cascade');
        });
    }

@tykus

Edit Your Profile
Update

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