Author :

I want to create multi events in socket io with redis this is my code *** var redisClient = redis.createClient(6379, "127.0.0.1"); redisClient.on(‘connect’, function() { console.log(‘we are connected with redis server’) }); redisClient.subscribe(‘message’,’call’,’status’); redisClient.on("message", function(channel, message) { var data = JSON.parse(message); console.log("new message in queue " + "channel : " + channel + " reciever: " ..

Read more

I’m trying to configure the site to work with Nginx and Apache. When I try to reach the site, I get a 403 error. In the file /etc/httpd/conf/httpd.conf I set the default port 8089 (since 8080 is already busy): Listen 127.0.0.1:8089 Next, I create a config for Apache (/etc/httpd/conf.d/site.conf): <VirtualHost 127.0.0.1:8089> ServerName site.com ServerAlias www.site.com ..

Read more

I can’t understand what I’m doing wrong. Create a linking table Users and Roles here is a sample migration code to create a table ““` Schema::create(‘users_roles’, function (Blueprint $table) { $table->unsignedBigInteger(‘user_id’); $table->unsignedBigInteger(‘role_id’); $table->foreign(‘user_id’) ->references(‘id’) ->on(‘users’) ->onDelete(‘cascade’); $table->foreign(‘role_id’) ->references(‘id’) ->on(‘roles’) ->onDelete(‘cascade’); $table->primary([‘user_id’,’role_id’]); }); ““` as a result, the first key is created, and with the second ..

Read more

I have a script whose task is to update data in edited posts without reloading. When I try to output to the console the data I receive, I get null. I do not understand why this is happening, I tried to transfer data directly formData.append(‘title’, ‘test’);, it also does not work. $.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: ..

Read more

when i in installed laravel am face that issue..? – Installing symfony/debug (v3.4.42): Downloading (failed) Downloading (failed) Downloading (failed) Failed to download symfony/debug from dist: The "https://api.github.com/repos/symfony/debug/zipball/518c6a00d0872da30bd06aee3ea59a0a5cf54d6d" file could not be downloaded (HTTP/1.1 500 Internal Server Error) Now trying to download from source – Installing symfony/debug (v3.4.42): Cloning 518c6a00d0 Cloning failed using an ssh key ..

Read more

I have form to edit/upload image in Laravel Project. <form action=”{{ route(‘picture.update’,$animal->sid) }}” enctype=”multipart/form-data” method=”POST”> <div class=”form-group”> <label class=”form_group_title”>Image</label> <img id=”file-image” src=”{{asset(‘/images’)}}/{{$animal->image}}” alt=”Preview” class=”hidden img-thumbnail”> <input id=”file-upload” type=”file” name=”image_upload” accept=”image/*” class=”hidden” onchange=”readURL(this);”> <label for=”file-upload” id=”file-drag”> <span class=”btn btn-light”>Select</span> </label> <div id=”start”> <i class=”fa fa-download” aria-hidden=”true”></i> <span class=”text-danger”>{{ $errors->first(‘image_upload’) }}</span> </div> </div> </form> <script> function readURL(input, ..

Read more

In his life, he only encountered an ajax 2 times and here again our paths intertwined with him and he gave me 422 errors. I googled and realized that 422 error is a validation error, but in what specific place the error, I just can not understand. This is my script <script type=”text/javascript”> $.ajaxSetup({ headers: ..

Read more

I tried to attach facebook login in laravel project. I created facebook app in my facebook develop account and installed socialite package in laravel project and implemented all necessary code(controller and model ) and database of course I set FACEBOOK_CLIENT_ID and FACEBOOK_CALLBACK_URL in .env file But when I click the facebook login button, error happens. ..

Read more

Looking at composer.json file in laravel project, I can find below “autoload”: { “psr-4”: { “App”: “app/” }, “classmap”: [ “database/seeds”, “database/factories” ] }, as far as I know App:”app/” means a name space starts with App has its source files under the app/ directory and it follows psr-4. however, there are ton’s of packages ..

Read more

I want to use pagination after getting my data from api resource But the server responds: Method IlluminateDatabaseEloquentCollection::pagination does not exist. public function index(Request $request ) { $perPage=$request->per_page; return response()->json([‘user’=>UserResource::collection(User::with(‘roles’)->get()->pagination($perPage))],200); } Source: Laravel Sta..

Read more

<div class=”float-right”> <form> <div class=”form-group row”> <div class=”col-sm-12″> <select class=”form-control” id=”select_id” > <option> Choose Class </option> @foreach($allclass as $classs) <option value=”{{$classs->id}}”> {{$classs->class}} </option> @endforeach </select> </div> </div> </form> </div> This is Where user choose Class and when user choose the class i want to view data as per the class . class SectionController extends Controller ..

Read more

User Model public function teachers() { return $this->hasMany(Teacher::class); } Teacher Model public function user(){ return $this->belongsTo(User::class); } TeacherController public function index() { $role_user = DB::table(‘roles’)->where(‘role’, ‘teacher’)->first(); $role_id = $role_user->id; $users = User::all()->where(‘role_id’,$role_id); return view(‘admin.teacher.index’) ->with(‘users’,$users); } In View <td class=”d-none d-sm-table-cell”>{{dd( $teacher->teachers->designation)}}</td> It Gives An Error like this Property [designation] does not exist on this ..

Read more

I’m going to get data from a database using axios. Props was announced as follows: <script> export default { props:[‘data’], } </script> <v-flex xs8> <question v-for=”question in questions” :key=”question.path” :data=question ></question> </v-flex> And During data connect router-link there were some issues. <h3 class=”headline mb-0″> <router-link :to=”data.path”> {{ data.title }} </router-link> <!– <router-link to=”data.path”> {{ data.title ..

Read more

I have web.php with $router->namedRoutes[‘c_k’] = $router->post(‘/c_k’, [‘uses’ => ‘[email protected]’]); in it. Also there is BController with cK method. Then, I have AController. In AController is action g_k. The problem: client makes get-request to g_k action in AController, and I want to redirect it to c_k action(it’s post, u remember?) of BController with some json ..

Read more