How to show specific table structure in a Laravel controller? - laravel

I forgot my cPanel credentials so that now i need to confirm about some table fields i.e data types etc so that I want to connect with that cPanel i am using Laravel 4.2 and have no env file. Can anybody can give me a solution for this problem.

Related

How to "connect" Laravel project with Craft 3 CMS Website

I've developed an app which fetches data from an API based on Laravel 5.5. The marketing landingpage of the app is based on Craft CMS Version 3. The marketing website and the API and the databases of both systems are running on the same server.
I want to generate landingpages for each row of table X of the Laravel database.
www.website.com/awesome-landingpage-about-{slug}
What is the best approach to realize this?
I don't want to fetch the data directly from Laravel's database
I don't want to synchronize the Craft CMS database with the Laravel (add/remove the rows from the laravel's database as entries to Craft)
It would be awesome to be able to have an entry-type "Landingpage" where we can optionally create a landingpage, referencing to an ID of the laravel table and add additional content for the landingpages.
Would be a JSON-API from Laravel to Craft CMS Plugin a good performant idea?
One option would be to use a Dynamic Route and just fetch the data from 127.0.0.1 (because same server) from the template file? Or is there a smarter way in Craft CMS?
Let's start of by:
"I don't want to fetch the data directly from Laravel's database"
I'm assuming you don't want to write code in CraftCMS to access another project's database. Good. IF you plan on having them do seperate jobs and use Laravel API for fetching data alone, let it handle it's own database.
"I don't want to synchronize the Craft CMS database with the Laravel (add/remove the rows from the laravel's database as entries to Craft)"
So, this is my question:
You want to be able to create landing pages based of Laravel's rows alone or based of Laravel's database row's and CraftCMS's?
It all comes down to how well you want to abstract both frameworks.
I would probably tell laravel to accept requests from authenticated user (a CraftCMS User) or from localhosts (from within the machine alone) and I'd create endpoints to add/remove/edit/get data at my disposal. I'd then fetch rows from Laravel and combine with my own (assume I'm the CMS).
Even in an intranet network, the request to tell laravel to access the database is longer than to access the database from CraftCMS, so you should expect a dependency between the two projects.
For point 3, you'll have to store information on each database about something. On CraftCMS's to store at least the ID's it's going to request to laravel and laravel will have to get an endpoint where it can insert new stuff, if you're planning on having additional content there.
I'm not entirely sure if I got the idea you're trying to show when you say "add additional content for the landing pages" but I'd try to keep it simple and abstract it's uses, Laravel to store this 'information' that the CMS shouldn't handle in the first place (or you can work out some extra tables and import them to the other database).
Impact performance? Depends on the ammount of data you've got

How can I setup an Authetication in Laravel within THE SAME TABLE?

I'ts just for practice and I need how to set up an Auth in Laravel but in the same table User. I know I have to use the default model User.php. I added my new column "type" where here I'm going to manage common users and admins. I edited and migrated that, also according to docs I created my guards and register providers but I don't know whats next. I know how to do it with another table but in the same table I have no idea how. I don't know how this Laravel's files works.

how to use laravel illuminate in a custom project

I have a static site with a lot of pages. Now I got a new requirement. Client need a Client Area, I am thinking to use laravel Database Eloquent, Session, Form/html, Session and want to use them as alias like use in laravel/lumen. The problem is that I want static pages same as it is with .html extension, is there any solution? I want some packages with aliases to speed up.
I spent a complete day on Configuring Input and Eloquent but I wasn't able to setup to other packages. But I don't know how to set aliases and service providers. Any idea?
Specific:
I need Laravel Some packages
Session,
FileSystem
Mail
Input
Database
Html/Form,
Validation
I don't need others packages and need aliases same as laravel used in (config/app)
yes you can use laravel components outside laravel project please read the article : http://www.richardbagshaw.co.uk/using-illuminate-components/

create first user in Laravel 5

This is my first time using Laravel 5. Never experienced with any of other framework like CakePHP, CodeIgniter, Yii, etc. I just know how to use make api REST with slim framework.
I already create a table users as I can't access <<URL>>/home. I create fields and load it some data. Whenever I want to try reset the password, it show error because I dont have table password_resets. What are the steps to be taken after install the Laravel actually.
Thanks
You don't need to create any table manually (and you shouldn't). In Laravel you have migrations that help you quickly create tables in your database and seeds (where you can put initial data to those tables).
In fresh Laravel installation you have 2 ready migrations (for creating users and password_resets tables). All you need to do is running your console, go to directory where you have your Laravel project and run:
php artisan migrate
to run those migrations. After running this command Laravel will create those 2 tables for you. Before, you need to have configured your database connection (look at config/database.php file)

phpMyAdmin has two database tables under one heading

I am in the process of moving my local website onto a live webhost and am having some confusion while exporting my database tables from phpMyAdmin.
I attached a screenshot for reference.
It seems as if there are two database tables that are being used for my website, I'm not sure how this happened though. What I am trying to figure out is which database table is the one that I need to export along with all my Joomla files?
I went into my htdocs to check the configuration.php file and it says that the database prefix is xxx (i made this up) BUT when I go look into that database table (on phpMyAdmin) the dates of creation don't match up but are current in the "other database table."
Thank you for your help.
Screenshot for reference
To ascertain which is the correct database, create a new user via the Joomla interface, then have a look at the users Joomla table via phpMyAdmin, in both databases, to see in which database the user got created.
This information can be found in your site's admin at Site => Global Configuration => Server

Resources