mehran

Experience

14,775

3 Best Reply Awards

  • Member Since 2 Years Ago
  • 123 Lessons Completed
  • 0 Favorites

30th March, 2017

mehran left a reply on Calling Post Action | Response With 404 • 7 months ago

Then may you check the route of [email protected]?

mehran left a reply on Calling Post Action | Response With 404 • 7 months ago

First thing, you may use make rather than create for Post factory.

May you paste the resulting error here?

18th December, 2016

mehran left a reply on Envoy: Echos Doesn't Work • 11 months ago

@TaylorOtwell Laravel.com doesn't have this method documented. Would you tell us whether it is @{{ "Hey, It's echo" }} the correct syntax?

mehran started a new conversation Envoy: Echos Doesn't Work • 11 months ago

I was watching the Envoy source code yesterday to see whether I can find a blade syntax for echo.

I think this method should do that and the syntax should be @{{ "Hey, It's echo" }} which will be compiled to echo "Hey, It's echo". But don't know why it gives me this error when running a task:

[[email protected]]: bash: line 2: {{: command not found

13th December, 2016

mehran left a reply on Automated Password-less Login Via Ssh • 11 months ago

Thanks to @mckinnonderek on GitLab.com . his answer helped me out with this issue, here

12th December, 2016

mehran left a reply on Automated Password-less Login Via Ssh • 11 months ago

Thank you @schmidtke182 but this is not what I am looking for. I'm using Gitlab CI to test and then deploy my laravel app via ssh to remote server. GitLab CI uses Docker to doing builds and I can't copy public key to the remote server to use ssh without password. So ithink the only way is using the remote server private key to use ssh without enter password. but I don't have any other idea how to do it.

mehran started a new conversation Automated Password-less Login Via Ssh • 11 months ago

It seems an easy to google question but it's 2 days that I can't find what I need. I have a server with an ssh key pair and I want to login to it using the private key.

I also tried ssh-agent but it still prompts for entering password:

$ eval $(ssh-agent -s)
$ ssh-add $SSH_PRIVATE_KEY
$ ssh [email protected]
[email protected]'s password: 

21st October, 2016

mehran left a reply on Factory Relationships • 1 year ago

$p->account->role() returns the relationship object $p->account->role returns the result of the relationship

You are calling attach() method on the result of the role's relationship, not the relationship object ! and it is expected that this code doesn't work.

So you may do this instead:

factory(App\Patient::class, 'male', 20)->create()->each(function($p) {
    $p->account->role()->attach(5);
});

7th October, 2016

mehran left a reply on Laravel Passport Scopes • 1 year ago

If you are using CreateFreshApiToken middleware, so I am not sure whether it is possible to use Token Scopes. Scopes may be useful when you have a Personal access token client.

So let's imagine you want to log in FooBar's website using your Twitter account. When the application redirects you to the twitter's server, then some requested scopes will be displayed to you when you are asked to approve the FooBar's requests.

So I think Laravel ACL is not related to Passport Token Scopes.

1st October, 2016

mehran left a reply on Elixir - Attribute Removal With --production • 1 year ago

You may change the behavior of minifyCss() method. hope it can help.

mehran left a reply on Webpack Problem In Elixir • 1 year ago

Make sure if you have buble and buble-loader in your node_modules directory

23rd September, 2016

mehran left a reply on Build An Extension Like Sass • 1 year ago

Successfully built it for Laravel Elixir 6: https://github.com/mehranrasulian/laravel-elixir-rtl-sass

mehran started a new conversation Build An Extension That Overrides Sass Extension • 1 year ago

I'm trying to build an extension for Laravel Elixir and found laravel-elixir-stylus as a good example. What I want is exactly sass extension except that I want to add 2 other plugins to it: rtlcss and postcss.

So should I just add them to Elixir.config.css.sass config and let CSSTask do what I want? Or also override gulpTask() method within CSSTask and pipe some other plugins I want ?

21st September, 2016

mehran left a reply on Laravel 5.3 Passport Unsupported Grant_type • 1 year ago

@Bassam May you show the related code for your Password grant request?

23rd July, 2016

mehran left a reply on Webpack Setup • 1 year ago

@stargatesg1 , webpack() just accept this 3 parameters webpack(src, baseDir, output).

15th July, 2016

mehran left a reply on Passing Form Data + File To An End-point • 1 year ago

So what is wrong with my code ?

14th July, 2016

mehran left a reply on Passing Form Data + File To An End-point • 1 year ago

@tomi Thanks. I got the idea from kuroski And this is all that I have right now: https://gist.github.com/miranrasuli/8338ebdd3ab2948b022f441015f6bca3

mehran left a reply on Passing Form Data + File To An End-point • 1 year ago

Yes, I have it.

13th July, 2016

mehran started a new conversation Passing Form Data + File To An End-point • 1 year ago

I use Laravel 5.2 and Vue.js 1.0 and what I want to do is passing a form data + file to a controller. If I don't pass any file, my Vue.js method would be:

data()  {
    return {
        formInputs: {}
    }
},
methods: {
  submitForm (event) {
    var action = event.srcElement.action
    Vue.http.patch(action, this.formInputs)
  }
}

and it works perfectly! But I don't know why I can't pass files using FormData() like this:

methods: {
  submitForm (event) {
    var action = event.srcElement.action

    var image = this.$els.avatar.files[0]

    var form = new FormData(this.formInputs)

    form.append('avatar', image)
    
    Vue.http.patch(action, form)
  }
}

In my Laravel controller, using $request->all() can't fetch any data with the above approach. How do you pass a form data + file ?

11th July, 2016

mehran left a reply on Guide: Add Webpack To Your Laravel-Elixir Ext For Vue Js Components • 1 year ago

@erikwstlund So now we can use webPack easier !

9th July, 2016

mehran left a reply on How It Works VueJS-Resource With Laravel Fields Validations • 1 year ago

@cklmercer May you share your plugin with us? Thanks!!

1st July, 2016

mehran left a reply on Guide: Add Webpack To Your Laravel-Elixir Ext For Vue Js Components • 1 year ago

@EmilMoe We can use the next big release of elixir as soon as Taylor releases Laravel 5.3 !!

(Here is what Jeffrey said)[http://www.laravelpodcast.com/episodes/41169-episode-46-laracon-books-jeffrey-hasn-t-read]

30th June, 2016

mehran left a reply on Grab Old Inputs In Components • 1 year ago

@abstractFlo That would be a great approach for other Laravel Helpers like {{ trans() }} !!!!

mehran left a reply on Guide: Add Webpack To Your Laravel-Elixir Ext For Vue Js Components • 1 year ago

@Presto How did you fixed this error Uncaught SyntaxError: Unexpected token import ? I get this error when I want to use vuestrap.

mehran left a reply on Guide: Add Webpack To Your Laravel-Elixir Ext For Vue Js Components • 1 year ago

@EmilMoe Do ya have any article/guide about how to use Rollup.js and Webpack For laravel ? Or we should wait until Jeffrey will release a new version of elixir?

mehran left a reply on Guide: Add Webpack To Your Laravel-Elixir Ext For Vue Js Components • 1 year ago

Thanks @midascodebreaker for your tut! I followed it step by step and even fixed some errors but (still had 1 more error!)[https://github.com/vuejs-templates/webpack/issues/116] So While I was googling for that error, I found a (GitHub repo)(https://github.com/dolbex/webpack-laravel) (Also thanks to dolbex) that has guided me how to successfully integrate vue-cli with my Laravel project!! Yea that works perfectly!

29th June, 2016

mehran left a reply on To Use Vue Components With Inline Templates Or Not? • 1 year ago

Sorry, I just forgot the principles of Asking questions right! Actually, I want to use some Laravel helper methods like {{ trans('foo.bar') }}. For example, I have this inline template in my Laravel views:

<navbar inline-template>
    <li class="nav-item">
        <a class="nav-link hidden-xs-down" href="{{ url('/') }}">
            @{{ auth.user.username }}
        </a>
    </li>
    <li class="nav-item">
        <a class="nav-link hidden-xs-down" href="{{ url('/') }}">
            {{ trans('application.nav-cart') }}
        </a>
    </li>
</navbar>

It works well in this way and I use a Navbar.js as my Vue component. But I can't use these helpers if I use Vuefy format for my components.

I saw Laravel Spark's views are using Vue inline-templates but I'm not sure what other Laravel developers do to handle this. Is it would be well to use inline templates ?

28th June, 2016

mehran started a new conversation To Use Vue Components With Inline Templates Or Not? • 1 year ago

Vue documents say that using inline templates is not a good practice. So What if I define templates inside their components but want to use, for example, Laravel helpers in my templates?

What do you do if you want to use your PHP helpers inside your templates?

12th June, 2016

mehran left a reply on Making Laravel Updates Automated? • 1 year ago

Very helpful. Thanks to all!

mehran left a reply on Making Laravel Updates Automated? • 1 year ago

Yes, updating a production software is not a good practice at all. but what if I, for example, make a new git branch of my project and run a shell script that will update the project? plus adding new codes and files comes to the specified Laravel version i want to upgrade to?

mehran started a new conversation Making Laravel Updates Automated? • 1 year ago

Hi! I know laravelshift.com that will do it greatly! But I am interested in how it can be done? Let's say I want to create a simple automated-Laravel-update Tool for myself. Is there any idea about what I need to know how to do that?

27th May, 2016

mehran left a reply on Laravel CI Testing With GitLab • 1 year ago

@bashy @Refringe @noeldiaz Thank You!! The scripts and discuses were really helpful!!

23rd May, 2016

mehran left a reply on Paying Via PayPal • 1 year ago

I forgot to read the laracasts-faqs before opening this discussion. Sorry!

mehran left a reply on Dropzone.js Column 'album_id' Cannot Be Null • 1 year ago

Your welcome ;)

mehran left a reply on Dropzone.js Column 'album_id' Cannot Be Null • 1 year ago

Hi @rpauwels . You may pass the album_id as a parameter to back-end within dropzone's config.

lets say you have you album_id within the dropzone-config.js as a variable. (Example: var album_id = {!! $album_id !!};) then it's easy to pass it through params: . somthing like this:

var album_id = {!! $album_id !!};

var myDropzone = new Dropzone(document.body, {
  params: {
    album_id: album_id
  }
});

Now you can use dropzone/bootstrap template and don't need to use forms.

mehran started a new conversation Paying Via PayPal • 1 year ago

Hi ! If i pay via PayPal then i should visit laracasts.com/paypal page. But it just happens if i would not be Signed in! So how it detect my account after paying for laracasts?

6th May, 2016

mehran started a new conversation Is Laravel Valet Just For Mac? • 1 year ago

I'm using Ubuntu as my OS but didn't tried valet on it yet. That's because the related laravel document says Valet is for Macintosh. I'm wrong?

11th April, 2016

mehran left a reply on Got A PHP Error While Using Tinker • 1 year ago

Hi @Petronetto! Actually no! I didn't received any answer and the project was just an exercise not for production.

mehran left a reply on Laravel 5: The Requested URL Was Not Found On This Server. • 1 year ago

It's too late for answering, but it still can help other devs.

So It may that under public you have a folder name as "about". That can be source of your problems.

17th January, 2016

mehran left a reply on Hi I Try To Upload Image In User Profile • 1 year ago

The syntax should be like this:

echo Form::open(array('url' => 'foo/bar', 'files' => true))

It is?

4th January, 2016

mehran left a reply on Styles Will Not Run On Some Specific Pages • 1 year ago

Using Laravel. The cause of that exception was executing php artisan route:cache so every time a new route will be added we should execute that command. instead we can use php artisan route:clear. Thank you again.

3rd January, 2016

mehran started a new conversation Having Trouble With "franzose/ClosureTable" Package • 1 year ago

Actually i want to create something like WordPress Categories. It's so flexible, specially when you want to delete a parent node without deleting its Children nodes.

I don't have any problem in creating, reading, updating or deleting a child node but I don't have any good idea about how to correctly delete a node that is parent and it's because the table have two columns position and real_depth and they should be update every time a parent node will be delete.

Thanks.

21st December, 2015

mehran started a new conversation An Issue With Closure Tables Mode • 1 year ago

Hi. I want to use closure table mode to implement hierarchical data in my application. So for example i have two tables like these:

categories category_closure

category_closure table work right when i use pure sql queries. Also i use pure queries (not eloquent) to insert data to this table in laravel. But i think that there should be better ways to implement and use "closure table mode" in laravel. that's right?

8th December, 2015

mehran started a new conversation Got A PHP Error While Using Tinker • 1 year ago

I have a products and tags Table with a pivot for them. And actually i created a record for both of them and attached one record to the pivot table like this

$product->tags->attach(1);

After that, when i executed this command:

$product->tags->toArray();

that gave me the correct result, But with this error message:

PHP error: PDO::prepare(): send of 326 bytes failed with errno=32 Broken pipe in /home/vagrant/code/shopper/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 319

I just wanted to report this error.

9th October, 2015

mehran left a reply on Styles Will Not Run On Some Specific Pages • 2 years ago

thank you!! It worked. but you think what's the problem of NotFoundHttpException when creating a new Route ?

mehran started a new conversation Styles Will Not Run On Some Specific Pages • 2 years ago

First, apologies if my English is bad. Actually I found that every time that I create a Route and try to load that Route definition in browser, laravel will throw an exception [NotFoundHttpException]. And then i found that i can handle it with execute route:cashe command every time that i create a route !!!! but next problem IS that currently I created a route parameter and every thing goes right in writing code for view and controller. And when I load that in browser, everything goes right and information will be show BUT without any Style of Javascript.

When I refer to browser console, it will show this error: Failed to load resource: the server responded with a status of 404 (Not Found)

and when I want to open css file that included, laravel will throw [NotFoundHttpException]

Edit Your Profile
Update

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