The energy sector is undergoing a paradigm shift to integrate the increasing volume of embedded renewable energy generation and creating local energy communities or LECs that have been an essential component in increasing the same. Peer to Peer (P2P) energy trading is one of the alternatives to curb the surplus energy flow and would also help in maintaining a dynamic balance between supply and demand in the power grid. In this paper, we propose a P2P energy trading mechanism with distributed solar photovoltaic, community battery storage, and electric vehicle charging points. Game theory is the most widely used approach for P2P energy trading because of its characteristic of solving complicated interactions between provider and receiver. In the present work, we have considered a coalition based cooperative game theory framework whose objective is to maximize the total profit of the coalition. The simulation framework of this mechanism has been tested on a local energy community with 100 households having 50 consumers and 50 prosumers creating a win-win approach for both consumers and prosumers (users able to generate and consume simultaneously). Various trading scenarios have been proposed in this paper depending on geographical location, maximum energy demand, and maximum energy generated. These trading scenarios have been tested on a low voltage model to check their feasibility for a real network. The best operational performance priority at each timeslot with solar PV and community storage has also been analyzed.