mkdesign82

mkdesign82

Member Since 3 Years Ago

Experience Points 4,180
Experience
Level
Lessons Completed 14
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

05 Dec
6 days ago

mkdesign82 left a reply on Can Access Accessor Model

getTestAttribute I've found the problem thanks guys

mkdesign82 started a new conversation Can Access Accessor Model

Hi guys

I'm adding a new accessor to my model class likes so

protected $appends = ['test'];

public function getTestAtribute(){

        return 0;
    }

but when I want to use that property it returns me null. also when I want to convert the object to array it throws an error

Call to undefined method Seula\JobOffer::getTestAttribute()

do you guys know what's wrong with that? I'm using laravel 5.7

15 Sep
2 months ago

mkdesign82 started a new conversation Test A User Login From Multi Perspective

Hi

I don't know if I'm doing this right or not, I'll randomly test a user login to see if the particular page works fine after the user gets login. Is this way is the right way? because I'm testing a specific page on each user login. some users survive that page others are not and at last face Laravel error page. am I doing it right?

11 Jul
5 months ago

mkdesign82 started a new conversation Redirecting Back On Validation Error Instead Of 422 JSON

hello

I have upgrade Laravel 5.2 to 5.5, after upgrading my validation does not work Property ever since, instead of return JSON 422 response the validation rules Redirecting back to 404 page.

I wanted to know if you guys have hit anything like this before?

10 Jul
5 months ago

mkdesign82 started a new conversation Queue Job Is Not Finishing

hello

I have upgraded my project from Laravel 5.2 to Laravel 5.5, I have 3 Cron jobs and they were working fine in the latest version but now after I've upgraded the project I can see a couple of Cron jobs but there are no records in job table?

so why the Cron job is working?

mkdesign82 started a new conversation Laravel 5.3 Too Much Connection

hello

I was using Laravel 5.2 for a while and after some time I upgrade the project to new version 5.3, now I have this problem which it creates too many connections on the database. and a lot of selects I can see on monitoring the database.

can any help me with this?

18 Apr
7 months ago

mkdesign82 left a reply on Send Email From LocalHost On Mac

hey bro,

now its show me something else

relay=smtp.gmail.com[74.125.70.109]:587, delay=5.1, delays=0.05/0.06/4.6/0.37, dsn=5.5.1, status=bounced (host smtp.gmail.com[74.125.70.109] said: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1  https://support.google.com/mail/?p=WantAuthError a16-v6sm1173811itd.29 - gsmtp (in reply to MAIL FROM command))

at first, I have used google app two verify authentication, then I've just changed the sasl_passwd file to use my password to log in google, but still nothing.

mkdesign82 started a new conversation Send Email From LocalHost On Mac

hi guys how to send email from my localhost in Macintosh? the only thing appears to me its the below error

relay=smtp.gmail.com[74.125.124.108]:587, delay=627, delays=613/0.11/14/0, dsn=4.7.8, status=deferred (SASL authentication failed; server smtp.gmail.com[74.125.124.108] said: 535-5.7.8 Username and Password not accepted.

guys do you have any idea?

14 Apr
7 months ago

mkdesign82 left a reply on Git Bug Branch

I've taken a look at the link, I can see hotfixes but there are no bugs? so bugs do not need a bug branch for them self? like #feature-number_of_feature, #issue-number-of-issue ?

mkdesign82 left a reply on Git Bug Branch

Thanks, bro for the link.

mkdesign82 left a reply on Git Bug Branch

will review or merging should do upon master branch or dev branch? if someone reviews my code and he/she was 100% sure that no bug is there, then why they merge it with dev branch? why then don't merge it with the master? I think in case I push my feature branches, then there is no need for dev branch?

mkdesign82 started a new conversation Git Bug Branch

hi guys I have made a couple of bug branches on my local machine and I wanted to know, should I push them to remote git or merge them with dev branch then push the dev branch?

30 Mar
8 months ago

mkdesign82 left a reply on Protect Php Webforms From Accessing Without Login

this coasts a lot of time, we are not in the faze of converting the project. I just wanna simpler solution thanks.

mkdesign82 started a new conversation Protect Php Webforms From Accessing Without Login

Hi guys

I have 20 forms (20 PHP file) made with pure PHP, there is no architecture used for building this 20 forms. some of this forms are using for the front of the website and some other are used for the back, dashboard panel. now I want to protect my dashboard panel. which only those users which are login should access it and block access for the rest of users which are not login.

the hierarchy of the application is as below

-- the front index.php invitaion.php language.php lession.php login.php register.php mainHeader.php payments.php pricing.php pricingPanel.php

-- the back panelDashboard.php panelAdmin.php panelCountries.php panelHeader.php panelFooter.php panelLanguage.php panelConsultancy.php panelKeyFacts.php panelExport.php PanelWorldViews.php

the above files as you can see they exist in the root directory. now I want to know how to create a middleware that coasts me fewer changes. or anything that solves my problem.

thanks for any help. if you guys need more info please inform me.

01 Feb
10 months ago

mkdesign82 started a new conversation Stop Users Of Accessing Files In Uploads Folder

Hello, I'm using Laravel 5.3 and I want to stop users from accessing files in the uploads folder. But I have figured it out, that when someone tries to access my file lets says a file name

http://localhost:8000/uploads/2000_2018-01-01_20-40-46_thumbnail_small.jpg

then the web.php folder will not work. I have put DD at the top of the page and I expected to get trigger but nothing happened. so that's mean if someone tries to access files the routes cant stop it.

Any clue?

21 Jan
10 months ago

mkdesign82 started a new conversation Pre Render Spa

Hi guys,

I'm working on a spa website now, and I'm stuck with the SEO of the website. I working with pre rending VUE module now, but I did not understand it well when I run web pack to build me the whole web pack.conf, it will clone the same index.html again

new PrerenderSpaPlugin(
            path.join(__dirname, 'resources/views'),
            [ '/about-us' ]
        )

the above code is the code I'm using and the result of the above code is a page which is similar to the index.html. so what's happened just now it just clones the index.html page that's it ? or maybe I did not understand it well.

17 Jan
10 months ago

mkdesign82 started a new conversation Stop Select The Database On Each Itterate

Hi,

I have a table with 700,000 records init with 20 column length, in part of my project I have a foreach which I should select one record from the table, for 400 iterates and 400 select, it took me 46sec to retrieve the 400 results. which is not good. guys do you have any idea to improve the speed and the time I use.

26 Dec
11 months ago

mkdesign82 started a new conversation Ip Middleware

Hello,

I have made an Ip address middleware which could protect my Controller from foreign accessing, but the problem is there that when I get call the API with Axios, Laravel reject the request with an error that said not authorized. if I removed the middleware anyone could access the API and this is not good. So any help.

19 Dec
11 months ago

mkdesign82 started a new conversation Using The Field Abb In WhereRaw

Hello guys,

I have a query which looks like below

 $circle_radius = 3959;
$max_distance = 20;
$lat = $this->lat;
$lng = $this->lng;

$query->select(DB::raw("id, (".$circle_radius." * acos( cos( radians(12) ) * cos( radians( user_metas.data->'lat' ) ) * cos(radians(user_metas.data->'lng') - radians(10)) +
                    sin(radians(10)) * sin(radians(user_metas.data->'lat'))))
                    AS distance"))->whereRaw(" distance < ".$max_distance)->get();

but after I execute the code laravel tells me there is no field as distance. guys how should I define an abb for a field. thanks for any help.

07 Nov
1 year ago

mkdesign82 started a new conversation Dd() Does Not Open All Ob The Objects In A Collection

Hi, I have 200 hundred records in a collection when i dd() these records only half of them are shown in the browser and the rest of them are close, how should I open all of the objects, should I force dd or something?

02 Nov
1 year ago

mkdesign82 left a reply on This Page Size Is 64kb But There Are Two JS Files Which Their Total Size Is Much Larger Than 1 Mb

I have tested the page in the test speed website and it also gives me the 64kb of size.

mkdesign82 started a new conversation This Page Size Is 64kb But There Are Two JS Files Which Their Total Size Is Much Larger Than 1 Mb

Hi,

Sorry for the bad title, I'm wondering how is that possible the page that IM init now is 64 kb, i mean the page that i write my comment from it, but there are two huge compressed JS file which their total size is much larger than 1 mb, i'm wondering if there are some way that i Dontknow how to handle magnifying.

thanks for any respond .

mkdesign82 started a new conversation Gulp Production Command Does Not Render Vue Components As Gulp Command

Hi,

I have made a datagridview vue.js components which it works fine when I use gulp command or gulp watch command, but when I use gulp production the components elements does not render as its expected. I have a select box which using it to show how many records datagridview shall shows. the html rendering is like below

<select class="form-control"><option value="10">10<option value="20">20<option value="50">50<option value="100">100</option></option></option></option></select>

Any one has any idea why this is happening and how should i fix this issue ?

29 Oct
1 year ago

mkdesign82 started a new conversation How To Use Laravel Elixir To Generate Appropriate Files In Production State

Hi,

I'm working on laravel project and everything goes fine until I wanted to publish my project to production but there are some wrong happened with the production, first of all, the addresses are my local address after I've changed my address to the host address it show's me an error that says

Access to Font at 'http://localhost:8000/fonts/IRANSans.ea6dfae.ttf' from origin 'http://panel.ahwazfeed.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://panel.ahwazfeed.com' is therefore not allowed access.

and my gulp file

const elixir = require('laravel-elixir');
var path = require("path");
//var extract = require("extract-text-webpack-plugin");
require('laravel-elixir-vue-2');
require('laravel-elixir-vueify');
/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for your application as well as publishing vendor resources.
 |
 */

elixir((mix) => {

    elixir.webpack.mergeConfig({
        output: {
             path: '/',
            //path:'http://panel.ahwazfeed.com',
            //publicPath: 'http://localhost:8000/' // Development Server
             publicPath: "http://panel.ahwazfeed.com/panel/" // Production Server
        },
        module: {
            loaders:[
                {
                    test: /\.js$/,
                    loader: 'buble-loader'
                },
                {
                    test: /\.css$/,
                    loader:'style-loader!css-loader!'
                },
                {
                    test: /\.scss$/,
                    loader: 'style-loader!css-loader!sass-loader'
                },
            
                {
                    test: /\.vue$/,
                    loader: 'vue-loader'
                }
            
            ]
        },
        resolve: {
            extensions: ['', '.js', '.vue', '.json', '.css'],
            alias: {
                vue: 'vue/dist/vue.js',
                'vue$': 'vue/dist/vue.esm.js'
            }
        }
        //plugins: [
        //    new extract("styles.css")
        //]
    });

    //mix.browserify('./resources/assets/js/app.js', './public/app.js');
    mix.webpack('./resources/assets/js/vendor-js.js', './public/vendor-js.js');
    mix.webpack('./resources/assets/js/vendor-css.js', './public/vendor-css.js');

    // factor
    mix.browserify('./resources/assets/js/invoice/create.js', './public/invoice-create.js');
    mix.browserify('./resources/assets/js/invoice/index.js', './public/invoice-index.js');

    // formula
    mix.browserify('./resources/assets/js/formula/create.js', './public/formula-create.js');

    // formula item
    mix.browserify('./resources/assets/js/formula/items/create.js', './public/create-item.js');

    //agent
    mix.browserify('./resources/assets/js/agency/create.js', './public/create-agent.js');

    //mix.sass('./resources/assets/sass/font.scss', "./public/font.css");
    //mix.browserify('./resources/assets/js/shared/data-grid.js', './public/data-grid.js');
    //mix.browserify('./resources/assets/js/shared/test.js', './public/test.js');

    //mix.sass('./resources/assets/sass/app.scss', 'public/app.css')
});

27 Oct
1 year ago

mkdesign82 started a new conversation Use A Single Javascript File Per Each Page

Hello, I'm working on laravel project, and I'm using vue.js for the front of my admin page. I have a couple of problems using VUE file on my page.

first: I should create a javascript file for each one of my pages, let's say I have [post/create, post/delete, post/update] this mean I should create 3 javascript file and use gulp to browsing them. now let's guess I had more pages like comments [comment/show, comment/answer, comment/update], now more javascript file comes on the way.

so I thought what if I Make one file like app.js and put all of my codes there, but the project is not going to be a spa so this solution is working only on spa's because refreshing the page is not necessarily on spa projects.

what should I do to decrease the javascript total files, and also using Vue for each page because I'm using Vue to handle all of the operations on the page?

thanks for any solution.

21 Aug
1 year ago

mkdesign82 started a new conversation How To Create A Tag In Git With Only Specific Commits

Hello guys, I'm working on a project and this project has two branches, I have made three changes on master branch, I want to create a tag based on the first commit, this is okay then I wanted to create the second tag on the third commit but I don't want to include the second commit on the second tag , does it have such command ?

25 Jul
1 year ago

mkdesign82 started a new conversation _vue2.default.validator Is Not A Function

Hello I'm using Elixir with my project, I have used the below code in my app.js

import Vue from 'vue';
import validators from 'vue-validator';

Vue.validator('email', function (val) {
    return /^(([^<>()[\]\\.,;:\[email protected]\"]+(\.[^<>()[\]\\.,;:\[email protected]\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(val);
});

after I include bundle.js in my project i can only see the error _vue2.default.validator. I'm also used Vue.use(validators); but the console show me a warning of [vue-validator] already installed.

I really don't know what's going on. I'll appreciate any help.

15 Jul
1 year ago

mkdesign82 started a new conversation Create Feature Branch In Git

Hello, guys, I'm new to git but I've learned most of the commands. I have started a new project and I have sold about 15 copy of this web project. now let's guess one my customer calls me and say, hey can you make me a feature for my project and in response I say yes why not so I began to start a new branch of the master branch and made that feature then I'll merge that branch with the master branch. every thing is good and okay until the same customer calls me and say hey can you make me a new feature, in response, i say yeah, so I began to start a new branch of a master branch. the problem is that when I made a new branch of master branch all of the codes from the first feature will clone in the second feature which I do not necessarily need that coz maybe one of my other customers call me and say I need the second feature, but as I describe above that feature maintain the first feature codes. so any one knows how to handle this kind of problems? or maybe I should make any feature as a package.

thanks for any help

14 Jun
1 year ago

mkdesign82 started a new conversation Bind Multiple Concrete On Same Abstraction

Hello, I'm binding 3 concrete class on one abstract class, now i want to inject the second concrete class into my constructor, but unfortunetly laravel only pass the last registered concrete class which is not what I'm looking for, so how should i resolve the third concrete class which i have registered for that abstract class into the container. thx for any help .

16 May
1 year ago

mkdesign82 started a new conversation Invalid Expression. Generated Function Body

Hello I have wrote a tutorial and into this tutorial I'm using vue curly braces syntax to print something out , and I'm also using vue in my blog too . when I have wrote that tutorial and wanted to reload the page then suddenly vue has warn me with an error , that error was referring to the curly braces {{route('post.index')}}, after understand the error whenever I see a curly braces i'll replace it with something else, until now its doing fine, but what should i do to avoid this problem ? the full error is

Vue warn]: Invalid expression. Generated function body:  "<p dir="scope.rtl">توی این آموزش میخوام نحوه ساختن دیتا گرید با استفاده از <code>vue.js</code> و <code>ajax</code> رو آموزش&nbsp;بدم . من توی محیط <code>laravel</code> میخوام این آموزش رو انجام بدم . لذا افرادی که با فرم ورک لاراول آشنایی کافی رو ندارن هیچ مشکلی نداره ، فقط فرض کنید که توی صفحات مختلف <code>php</code> بخواید از <code>vue.js</code> استفاده کنید .</p>\n<p dir="scope.rtl">کاراهای که واسه ساختن این دیتا گرید باید انجام بدیم .</p>\n<p dir="scope.rtl">1 - ساختن یک بانک اطلاعاتی فرقی نمیکنه ، Mysql , Sqlsrv</p>\n<p dir="scope.rtl">2&nbsp;- ایجاد ارتباطات بین فرم ورک و بانک اطلاعاتی</p>\n<p dir="scope.rtl">3&nbsp;- ساختن یک تیبل و ایجاد model من اینجا از یک تیبل به نام posts استفاده میکنم.</p>\n<p dir="scope.rtl">4&nbsp;- ایجاد یک کنترلر به نام postController و ساخت یک اکشن به نام index</p>\n<p dir="scope.rtl">5&nbsp;- ایجاد یک route به نام اکشن تعریف شده در کنترلر .</p>\n<p dir="scope.rtl">6&nbsp;- ساخت core اصلی دیتا گرید با vue.js</p>\n<p dir="scope.rtl">7&nbsp;- تبدیل core &nbsp;به کمپوننت .</p>\n<h4 dir="scope.rtl"># ساخت یک بانک اطلاعاتی</h4>\n<p dir="scope.rtl" style="scope.text-scope.align:scope.right;">واسه ساختن بانک اطلاعاتی خیلی راحت میتونید با استفاده از Phpmyadmin یک بانک اطلاعاتی رو بسازید . اسم بانک اطلاعاتی را میزارم datagrid .&nbsp;</p>\n<h4 dir="scope.rtl" style="scope.text-scope.align:scope.right;"># ایجاد ارتباط بین فرک ورک و بانک اطلاعاتی</h4>\n<p dir="scope.rtl">واسه ایجاد کردن ارتباط بین فرم ورک و بانک اطلاعاتی مورد نظر میتونیم از فایل .env اقدام کنیم و این دستورات رو به اطلاعات مورد نظر خودمون تغییر بدیم .</p>\n<pre class="scope.language-scope.php"><code>DB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=datagrid\nDB_USERNAME=root\nDB_PASSWORD=</code></pre>\n<p dir="scope.rtl" style="scope.text-scope.align:scope.right;">&nbsp;</p>\n<h4 dir="scope.rtl" style="scope.text-scope.align:scope.right;"># ساخت یک تیبل با استفاده از migrations</h4>\n<p dir="scope.rtl">با استفاده از دستور</p>\n<pre class="scope.language-scope.php"><code>php artisan make:migration post</code></pre>\n<p dir="scope.rtl">یک فایل migration ساخته میشود که توی متد up &nbsp;میتونید دستورات پایین رو بنویسید .</p>\n<pre class="scope.language-scope.php"><code>Schema::create('posts', function (Blueprint $table) {\n    $table-&gt;increments('id');\n    $table-&gt;string('title');\n    $table-&gt;string('content');\n    $table-&gt;string('slug');\n    $table-&gt;string('thumbnail');\n    $table-&gt;timestamps();\n});</code></pre>\n<p dir="scope.rtl">سپس با استفاده از دستور زیر&nbsp;تیبل مورد نظر با موفقیت ساخته میشود .</p>\n<pre class="scope.language-scope.markup"><code>php artisan migrate</code></pre>\n<p dir="scope.rtl">بعد از ساخت تیبل میتوانیم با استفاده از مدل خود را ایجاد کنیم .</p>\n<pre class="scope.language-scope.php"><code>php artisan make:model Post</code></pre>\n<p>&nbsp;</p>\n<h4 dir="scope.rtl" style="scope.text-scope.align:scope.right;"># ایجاد کنترلر &nbsp;postController و اکشن index</h4>\n<pre class="scope.language-scope.php"><code>php artisan make:controller PostController</code></pre>\n<p dir="scope.rtl">ایجاد یک اکشن در کنترلر به نام index</p>\n<pre class="scope.language-scope.php"><code>public function index(){\n   \n    reutrn Post::get();\n}</code></pre>\n<h4 dir="scope.rtl" style="scope.text-scope.align:scope.right;">#&nbsp;ایجاد یک route &nbsp;با نام اکشن مورد نظر</h4>\n<pre class="scope.language-scope.php"><code>Route::get("scope.post", ["scope.as"=&gt;"scope.post.index", "scope.uses"=&gt;"[email protected]"])</code></pre>\n<h4 dir="scope.rtl" style="scope.text-scope.align:scope.right;"># ساخت core &nbsp;اصلی datagrid</h4>\n<pre class="scope.language-scope.markup"><code>&lt;div class="scope.container"&gt;\n   &lt;table&gt;\n      &lt;tr&gt;\n          \n      &lt;/tr&gt;\n   &lt;/table&gt;\n&lt;/div&gt;</code></pre>\n<p dir="scope.rtl">خوب خیلی راحت یک تیبل ساختیم که این تیبل شامل یک تگ tr &nbsp;میباشد .&nbsp;</p>\n<p dir="scope.rtl">حالا میخوایم مقادیر رو با استفاده از ajax صدا بزنیم و در یک متغیر data آنها رو بریزیم .</p>\n<pre class="scope.language-scope.javascript"><code>new Vue({\n    el:".container",\n    data:{\n        posts:""\n    }\n    ready:function(){\n        var vm = this;\n        $.ajax({\n            url:"{!!scope.action('[email protected]')!!}",\n            type:"scope.get",\n            success:function(e){\n                vm.posts = e;\n            }\n        })\n    }\n})</code></pre>\n<p dir="scope.rtl">بعد از اینکار باید بتوانیم مقادیر موجود در متغیر را نشان دهیم .</p>\n<pre class="scope.language-scope.markup"><code>&lt;div class="scope.container"&gt;\n   &lt;table&gt;\n      &lt;thead&gt;\n          &lt;tr&gt;\n            &lt;td&gt;#&lt;/td&gt;\n            &lt;td&gt;موضوع&lt;/td&gt;  \n            &lt;td&gt;تاریخ ایجاد&lt;/td&gt;\n            &lt;td&gt;تاریخ ویرایش&lt;/td&gt;    \n          &lt;/tr&gt; \n      &lt;/thead&gt;\n      &lt;tr v-for="scope.postinposts"&gt;\n          &lt;td&gt;@"+("post.title")+"'&lt;/td&gt;\n      &lt;/tr&gt;\n   &lt;/table&gt;\n&lt;/div&gt;</code></pre>\n<p>&nbsp;</p>
09 May
1 year ago

mkdesign82 started a new conversation Killing The Execution After Certain Time Of Sleep .

Hello I have a text box, on key up event it'll call an ajax and the ajax method send the request to the server . server w'll do some operations and it return back the results . every thing till now working fine . if some one type something too fast then something bad going to happened , it will rapidly send requests until it finishes it job and this is not good . so what do I need, I want to use sleep method and save any request until i reach the last request. so i mean if there were 5 request one after other, I should only care about the last request, grab the last request do some calculation and then return the result . I can do this with jquery but i want to do it with php . request ... request ... request ... request ...

If any one knows how to be done . i'll appreciate.

23 Apr
1 year ago

mkdesign82 started a new conversation Convert Payload Field In Job Table

Hello, how to run the operations in the Payload field in job table and i'll like to know how laravel really make work of that field . Thx for any help .

08 Apr
1 year ago

mkdesign82 left a reply on Access Parent Component Data From The Nested Child Component

hi @mdecooman

thx for the respond, but I think vuex will help me alot on this problem share the store property .

mkdesign82 left a reply on Access Parent Component Data From The Nested Child Component

@Abi thx for the description, but I didn't write nested components. I've used the second component into the first component but they are totaly separated. I mean i did not do it like below

vue.component("first-component", { template:"

first-component

", component:{

} })

so in this case i cant access the parent data i just can access root data.

but if I wrote my component using the above structure then I think some problems go away

03 Apr
1 year ago

mkdesign82 left a reply on Access Parent Component Data From The Nested Child Component

var parent = new Vue({
    el:"app"
})

vue.component("first_component", "<div>  <second_component></second_component>  </div>")

vue.component("second_component", "<div> this is the second component </div>")

this.$parent.data will access the parent data, But i want to access the first_component data from the second_component.

this going to be happen if I pass the data to the parent then broadcast it to the childrens, but this not what I want, coz it makes alot of duplication.

mkdesign82 started a new conversation Access Parent Component Data From The Nested Child Component

hi I have made a component which inner of this component i have another component What do i really want to do is to access the first component data from the second child component .


<template id="gallery">
    <div class="gallery_wrapper">
        <div class="modal fade uploader" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" style="padding:0px !important;">
            <div class="modal-dialog  modal-lg" role="document">
                <div class="modal-content" style="border-radius: 2px;">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" style="float:left;" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">آپلود</h4>
                    </div>
                    <div class="modal-body" style="padding-right:3px;padding-left:0px;">
                        <!-- Nav tabs -->
                        <ul class="nav nav-tabs" role="tablist">
                            <li role="presentation" style="float:right" v-bind:class="{active: active_file_tab}" class="active"><a href=".show_upload" aria-controls="upload" role="tab" data-toggle="tab">آپلود</a></li>
                            <li role="presentation" style="float:right" v-bind:class="{active: !active_file_tab}" ><a href=".show_gallery" v-on:click="getGallery" aria-controls="show" role="tab" data-toggle="tab">نمایش</a></li>
                        </ul>

                        <!-- Tab panes -->
                        <div class="tab-content" style="height:inherit">
                            <div role="tabpanel"  class="tab-pane active show_upload" v-bind:class="{active: active_file_tab}" style="position:relative;height:inherit" id="upload">
                                {!! Form::open(["url"=>action('[email protected]'), "class"=>"dropzone", "id"=>"dropzone", "style"=>"height:100%;"]) !!}
                                <input type="file" name="file" style="display:none;" />
                                {!! Form::close() !!}
                            </div>
                            <div role="tabpanel" class="tab-pane show_gallery" v-bind:class="{active: !active_file_tab}" id="show">
                                <div class="uploader_file_info">
                                    <p>@{{file_name}}</p>
                                    <p>@{{file_created_date}}</p>
                                    <p>@{{file_size}}</p>
                                    <p>@{{file_dimensions}}</p>
                                </div>
                                <div class="files_wrapper" style="width: 80%;float: left;">
                                    <div class="uploader_tools_wrapper" style="padding:12px;overflow:auto;">
                                        <input type="text" placeholder="جستجو" value="" v-model="searched" v-on:keyup="search" style="width: 16%;height: 30px;font-size: smaller;"/>
                                    </div>
                                    <upload_file_wrapper :selected_file="selected_file"></upload_file_wrapper>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer" style="clear:both;">
                        <button type="button" class="btn btn-primary" v-on:click="useFile">استفاده از فایل</button>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="uploader_modal btn btn-primary" v-bind:style="style" v-on:click="showModal" style="font-size: smaller;float:left;">
            @{{ ( button_name != undefined ) ? button_name : استفاده از گالری}}
        </a>
    </div>
</template>

<template id="upload_file_wrapper">
    <span class="file_container" v-for="file in $parent.files" v-show="file.visible == true">
            <span class="file_size_wrapper" transition="fade" v-show=" file.show_size == true && $parent.selected_file.length > 0 ">
                <span class="file_size">
                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_large', $event)"
                          v-show="file.thumbnail_large == true">LG</span>

                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_big', $event)"  v-show="file.thumbnail_big == true">BG</span>
                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_small', $event)"  v-show="file.thumbnail_small == true">SM</span>
                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_extra_small', $event)"  v-show="file.thumbnail_extra_small == true">XS</span>
                </span>
            </span>
            <span class="file_wrapper" v-bind:class="{activate:file.is_active}" v-on:click="toggleCheck($index)">
                @{{{filterFiles(file)}}}
            </span>
        </span>
</template>

01 Apr
1 year ago

mkdesign82 left a reply on Test Controller Static Method

For that error ... yeah, I use classmap in my composer

"classmap": [
            "database",
            "app/helpers/class"
        ]

and yeah my class is located in that directory app/helpers/class, Thumbnail.php and I access it in my controller with use Thumbnail;

I think i'll not face any problem to test the Thumbnail class itself, but what I wanted to test is the full controller method, integration test which the static thumbnail::make method should be part of it.

I know that thumbnail class is working pretty fine but I want to test it in different situations .

mkdesign82 left a reply on Test Controller Static Method

nope, I have not perform any Unit Test for that method Make in that class Thumbnail .

mkdesign82 started a new conversation Test Controller Static Method

hi I have called static method from my controller how should I test this method ?

controller code

 $this->validate($this->request, ["title"=>"required|unique:posts,title"]);
        $inputs = $this->request->except(["_token"]);

        // If the visible status was not on then we set it to 1
        if ($this->request->visible == "on")
            $inputs["visible"] = 1;

        // If there was thumbnail
        $inputs["thumbnail"] = Thumbnail::make($inputs["thumbnail"]);

        $post_id = $this->post->create($inputs)->id;

        // return back on http request
        if (!$this->request->ajax()){
            return redirect(action('[email protected]'))
                ->with(["msg"=>"post has been created."]);
        }else{
            return json_encode(["post_id"=>$post_id, "part"=>"create"]);
        }

31 Mar
1 year ago

mkdesign82 left a reply on Calling Post Action | Response With 404

I found the problem , it was the middleware which was stopping my request .

30 Mar
1 year ago

mkdesign82 left a reply on Calling Post Action | Response With 404

Thx Mehran, but it was not the main problem . the return result is 404 ، Page not found . by the way I faced this problem only when using http post . I do not have any problem with get .

mkdesign82 left a reply on Calling Post Action | Response With 404

I have dd it now and the result was " http://localhost/panel/post/store " I think is okay ?

mkdesign82 started a new conversation Calling Post Action | Response With 404

Hi there I'm new to testing . what do i want to do is to post a data to controller action . this is my code .

 public function test_create_new_post()
    {

        Session::start();

        $user = new User(["name"=>"mkdesign82"]);
        $this->be($user);

        $post = factory(App\Post::class)->create()->first()->toArray();
        $post["_token"] = Session::get("_token");

        $this->call('post', action('[email protected]'), $post);

        $this->assertResponseStatus(200);

    }

But what do i get is 404 what did i miss there ?

18 Mar
1 year ago

mkdesign82 started a new conversation Access Parent Data In Class Binding

Hello I have problem access parent data from my component, binding class

<template id="upload_file_wrapper">
        <span class="file_container" v-for="file in $parent.files" v-show="file.visible == true">
            <span class="file_size_wrapper" transition="fade" v-show="file.show_size == true">
                <span class="file_size">
                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_large')" v-bind:class="{ 'testy': ( this.$parent.selected_file.indexOf(file.name+'thumbnail_large') >= 0 ) }"   v-show="file.thumbnail_large == true">LG</span>
                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_big')"  v-show="file.thumbnail_big == true">BG</span>
                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_small')"  v-show="file.thumbnail_small == true">SM</span>
                    <span class='thumbnails' v-on:click="selectSize(file.name, 'thumbnail_extra_small')"  v-show="file.thumbnail_extra_small == true">XS</span>
                </span>
            </span>
            <span class="file_wrapper" v-bind:class="{activate:file.is_active}" v-on:click="toggleCheck($index)">
                @{{{filterFiles(file)}}}
            </span>
        </span>
    </template>

I have written a little of logic on the binding class but it says Cannot read property 'indexOf' of undefined what is the problem there ?

20 Nov
2 years ago

mkdesign82 started a new conversation Share Data Between Components

Hi there, any one know how to share data between two components . lets assume that i have a textbox which it's bind to the search variable . and i want to access this search variable from another component . the second component is a select element which i want to access that textbox value on each change .

any one know's how that done ?

18 Nov
2 years ago

mkdesign82 left a reply on .ToSql Does Not Understand Model With Relation

Pmall

This is how eager loading (with) works, one query per relationship.

So you mean , there are no way to get the

select * from `posts` inner join status on posts.status_id = status.id where `posts`.`deleted_at` is null and `type` = ? limit 2

mkdesign82 started a new conversation Using .ToSql To Get The Sql Relation

Hello, I want to use .toSql on a joined model but this method is return

$posts = $this->post->whereType("news")->with("status")->take(2)->toSql();

dd($posts);

select * from `posts` where `posts`.`deleted_at` is null and `type` = ? limit 2

which is not what i'm looking for , so after a while i have found a new solution and it's DB::getQueryLog(); but what this method return for me is two separate select , yeah is true it separates the selects but i want the inner joined select , so any body know how should i found this joined select ?

17 Nov
2 years ago

mkdesign82 left a reply on How To Use Appends Attribute In Where Condition

$appends = ["sum_col"];

public function scopeCompare($query){
  $query->where("first_col", ">=", $this->sum_col);
}

but this is not possible ?

mkdesign82 started a new conversation How To Use Appends Attribute In Where Condition

Hello , I have a problem using appends attribute in Where condition . I want to compare one of my field in the database with the appends attribute which it contains some value .

but what do i really looking for is that to use the appends attribute in where condition ... but this is not going to be work because its not a database field .

so any clue on how to resolve this problem ?

thanks for any help .

20 Oct
2 years ago

mkdesign82 left a reply on WhereHas Does Not Return All Records On Empty Search

@willvincent Well is not about the operator sign , is about returning all records if the search keyword was empty. By the way you can reference the object propertise from the inside of the closure . and Ofcourse we should use (use) to import variable into the closure , but my question was not related to how using course_id in the closure.