Laravel create and store failure - laravel

I have a resource controller and create page. I need add some resources via store function. The store post url is xxx/xxx. Create get url is xxx/xxx/create. How can i post something via create url? Store post does have to be like xxx/xxx/create?
(Sorry for bad grammar)

Related

Create url rewrites automatically for store view which is created programmatically

When new store view is created from magento admin backend, all url rewrites for that store view are created automatically. But when I create programmatically store view from frontend, it's been created but without url rewrites, so basically I will need to create all url rewrites manually but it's impossible since there where about 3000 of them.
I cant find piece of code where magento created those url rewrites automatically after store view is created from admin backend.
The url generation for catalog happens here:
https://github.com/magento/magento2/blob/7aa94564d85e408baea01abc5315a0441401c375/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml#L10
and I assume that this plugin just not dispatched in your case, since you are creating store view from frontend scope

How do I populate data in intercom custom attributes from segment?

Segment offers page method call, where you can track the previous URL of a visitor prior to coming on your website.
I have this referrer URL with me, I want to push this referrer URL to intercom.
What I really want to do?
Whenever a user signs up on our software, I want to track his previous URL and make it available in intercom under his profile.
Also, the custom attribute created in intercom by me is not working since I don't know what code I should write in my intercom code snippet.
Please refer screenshots.
Intercom
Segment
Intercom by default saves the Referral URL of the user in a field called Referral url.
Else if you want to manually push referrer URL as a custom attribute you can send the parameter in the following way:
Intercom('boot', {
app_id: '<<Your App ID>>',
referrer:document.referrer, //custom attribute id which you have created in intercom
});

Encrypt URL with PHP Codeigniter

I have developed a website with PHP Codeigniter. It consists of many controllers and views. I want to encrypt the URL of the site to hide the controller and function name. Currently, the URL looks like this :
www.sitename.com/controller_name/function_name
I don't want the users to see the controller and function names. Is it possible to do this now because the site is almost complete. Is there any shortcut of doing this? Please Help
You can use codeigniter URI Routing to remove your controller name from URL.
$route['url_name'] = 'controller_name/function_name';
This `www.sitename.com/url_name` will look go to `www.sitename.com/controller_name/function_name`
$route['url_name/(:any)'] = 'controller_name/$1';
This will only change your controller name.. `controller_name` to `url_name`

Codeigniter - Htaccess : How to change a controller name

This is my first question here, so Hi all! ^^
I created a website with codeigniter framework and I have inserted a module for multilanguage. The url looks like this:
http://www.mywebsite.com/en/controller/function
The problem came when the client wanted to send a newsletter to all its customers in another language, but do not want to send the url with the controler with the name in english, because the newsletter is for spanish users.So:
URL is going to be send:
http://www.mywebsite.com/es/thecontroller
URL the client wants to be send ("elcontrolador" is "thecontroler" in spanish):
http://www.mywebsite.com/es/elcontrolador
I dont want to create another controler named "elcontorlador" only to show the same page as "thecontroler", because we don't want duplicate content for SEO purposes.
So, i want via .htaccess, a rule that when i type
http://www.mywebsite.com/es/elcontrolador
in the URL, mywebpage shows the info of
http://www.mywebsite.com/es/thecontroler
but with the URL
http://www.mywebsite.com/es/elcontrolador
(the controler "elcontrolador" doesnt exist).
So, is there any way to do this with the htaccess? I've tried it myself but I failed miserably i come here desperate, because I run out of time to deliver it and can not find a viable solution. I'll have to create the extra controller?
Need help D:
Maybe you can use the route config file instead to achieve this ?
$route['es/elcontrolador'] = 'es/thecontroler';
I don't know how you handle your multilangage, but you've got the idea.

Where to configure routes and paths in Ruby on Rails?

Probably a noob question but I'm new to Rails and building my first app as a project to complete my apprenticeship.
I have four pages listing contact, account, billing plan and call information. Each have that standard edit, show and create functions.
I have a table that pulls information from FreeAgent using the API, It just lists basic information (price, due date etc.) I want to create another page so when the user clicks on the invoice they go to another page containing a PDF and more information.
So instead of the path being /accounts/'user id' I want it to be /accounts/'user id'/invoice
Do I need to create another controller or just define a new method in the accounts controller?
Cheers
Arran
I suggest you read the RoR Guide on Routing first, especially the section on nested resources.
Your routes in routes.rb probably look something like this:
resources :accounts
resources :invoices
The aforementioned guide will teach you that you should define the routes like this instead:
resources :accounts do
resources :invoices
end
which will give you these routes
verb route action
------------------------------------------------
GET /accounts/:account_id/invoices index
GET /accounts/:account_id/invoices/new new
POST /accounts/:account_id/invoices create
GET /accounts/:account_id/invoices/:id show
and so on ...

Resources